Skip to contentSkip to conversation

scsi: ufs: Release clock if DMA map fails

PATCH New Eric Biggers 1 participant 1 message May 26, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: ufs: Release clock if DMA map fails

From: Can Guo <[email protected]>

commit 17c7d35f141ef6158076adf3338f115f64fcf760 upstream. [Please apply to 5.4-stable and earlier.]

In queuecommand path, if DMA map fails, it bails out with clock held. In this case, release the clock to keep its usage paired.

[mkp: applied by hand]

[EB: resolved cherry-pick conflict caused by newer kernels not having
the clear_bit_unlock() line]

---
 drivers/scsi/ufs/ufshcd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/ufs/ufshcd.c +1 -0
index 13ab1494c384..bc73181b0405 100644
@@ -2480,6 +2480,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
 
 	err = ufshcd_map_sg(hba, lrbp);
 	if (err) {
+		ufshcd_release(hba);
 		lrbp->cmd = NULL;
 		clear_bit_unlock(tag, &hba->lrb_in_use);
 		goto out;
Signature · 1 line
2.27.0.rc0.183.gde8f92d652-goog