mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Peter Wang (王信友)" <peter.wang@mediatek.com>
To: "avri.altman@wdc.com" <avri.altman@wdc.com>,
	"vamshigajjela@google.com" <vamshigajjela@google.com>,
	"alok.a.tiwari@oracle.com" <alok.a.tiwari@oracle.com>,
	"cw9316.lee@samsung.com" <cw9316.lee@samsung.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
	"adrian.hunter@intel.com" <adrian.hunter@intel.com>,
	"beanhuo@micron.com" <beanhuo@micron.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"James.Bottomley@HansenPartnership.com"
	<James.Bottomley@HansenPartnership.com>,
	"can.guo@oss.qualcomm.com" <can.guo@oss.qualcomm.com>
Subject: Re: [PATCH v2] scsi: ufs: core: Fix NULL pointer dereference in scsi_cmd_priv() calls
Date: Fri, 29 May 2026 09:09:33 +0000	[thread overview]
Message-ID: <ef9303ff3cdfc1f8c37f40740ca5e1619b82b9c0.camel@mediatek.com> (raw)
In-Reply-To: <20260529010739.295391-1-cw9316.lee@samsung.com>

On Fri, 2026-05-29 at 10:07 +0900, Chanwoo Lee wrote:
> ufshcd_tag_to_cmd() may return NULL if no command is associated with
> the given tag. However, several callers dereference the returned cmd
> pointer via scsi_cmd_priv() without checking for NULL first, leading
> to a potential NULL pointer dereference.
> 
> Fix this by adding NULL checks for cmd before calling scsi_cmd_priv()
> and moving the lrbp initialization after the NULL check.
> 
> Signed-off-by: Chanwoo Lee <cw9316.lee@samsung.com>
> ---

Reviewed-by: Peter Wang <peter.wang@mediatek.com>

  reply	other threads:[~2026-05-29  9:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260529010749epcas1p2bf38209e55149f0681550c220e541e92@epcas1p2.samsung.com>
2026-05-29  1:07 ` Chanwoo Lee
2026-05-29  9:09   ` Peter Wang (王信友) [this message]
2026-05-29 17:34   ` Bart Van Assche
2026-06-02  1:58   ` Martin K. Petersen
2026-06-09  1:38   ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ef9303ff3cdfc1f8c37f40740ca5e1619b82b9c0.camel@mediatek.com \
    --to=peter.wang@mediatek.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=adrian.hunter@intel.com \
    --cc=alim.akhtar@samsung.com \
    --cc=alok.a.tiwari@oracle.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=can.guo@oss.qualcomm.com \
    --cc=cw9316.lee@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=vamshigajjela@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®