Re: [PATCH v2] scsi: ufs: core: Fix NULL pointer dereference in scsi_cmd_priv() calls
From: Martin K. Petersen
Date: Mon Jun 08 2026 - 21:41:58 EST
On Fri, 29 May 2026 10:07:39 +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.
>
> [...]
Applied to 7.2/scsi-queue, thanks!
[1/1] scsi: ufs: core: Fix NULL pointer dereference in scsi_cmd_priv() calls
https://git.kernel.org/mkp/scsi/c/4cf752f6b99a
--
Martin K. Petersen