summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChenyuan Yang <chenyuan0y@gmail.com>2025-04-12 14:59:09 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-05-02 07:59:01 +0200
commiteeab6618037be84e438e9d6ed5d9a53502faf81f (patch)
tree4a0210cdd618923bdf046bb0fdabf0342b14c6d8
parent29daa63f2c754012716301759e8db1f0950ac876 (diff)
scsi: ufs: core: Add NULL check in ufshcd_mcq_compl_pending_transfer()
[ Upstream commit 08a966a917fe3d92150fa3cc15793ad5e57051eb ] Add a NULL check for the returned hwq pointer by ufshcd_mcq_req_to_hwq(). This is similar to the fix in commit 74736103fb41 ("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: ab248643d3d6 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/ufs/core/ufshcd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 89fc0b566291..8d4a5b8371b6 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -5689,6 +5689,8 @@ static void ufshcd_mcq_compl_pending_transfer(struct ufs_hba *hba,
continue;
hwq = ufshcd_mcq_req_to_hwq(hba, scsi_cmd_to_rq(cmd));
+ if (!hwq)
+ continue;
if (force_compl) {
ufshcd_mcq_compl_all_cqes_lock(hba, hwq);