Skip to content

Commit 08a966a

Browse files
WhiteFox-Projectmartinkpetersen
authored andcommitted
scsi: ufs: core: Add NULL check in ufshcd_mcq_compl_pending_transfer()
Add a NULL check for the returned hwq pointer by ufshcd_mcq_req_to_hwq(). This is similar to the fix in commit 7473610 ("scsi: ufs: core: Fix ufshcd_abort_one racing issue"). Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com> Link: https://lore.kernel.org/r/20250412195909.315418-1-chenyuan0y@gmail.com Fixes: ab24864 ("scsi: ufs: core: Add error handling for MCQ mode") Reviewed-by: Peter Wang <peter.wang@mediatek.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 54bebe4 commit 08a966a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5678,6 +5678,8 @@ static void ufshcd_mcq_compl_pending_transfer(struct ufs_hba *hba,
56785678
continue;
56795679

56805680
hwq = ufshcd_mcq_req_to_hwq(hba, scsi_cmd_to_rq(cmd));
5681+
if (!hwq)
5682+
continue;
56815683

56825684
if (force_compl) {
56835685
ufshcd_mcq_compl_all_cqes_lock(hba, hwq);

0 commit comments

Comments
 (0)