Skip to content

Commit a1e17eb

Browse files
dinghaoliumartinkpetersen
authored andcommitted
scsi: ufs-bsg: Fix runtime PM imbalance on error
When ufs_bsg_alloc_desc_buffer() returns an error code, a pairing runtime PM usage counter decrement is needed to keep the counter balanced. Link: https://lore.kernel.org/r/[email protected] Fixes: 74e5e46 (scsi: ufs-bsg: Wake the device before sending raw upiu commands) Reviewed-by: Avri Altman <[email protected]> Signed-off-by: Dinghao Liu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent b3a9e3b commit a1e17eb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/scsi/ufs/ufs_bsg.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,10 @@ static int ufs_bsg_request(struct bsg_job *job)
106106
desc_op = bsg_request->upiu_req.qr.opcode;
107107
ret = ufs_bsg_alloc_desc_buffer(hba, job, &desc_buff,
108108
&desc_len, desc_op);
109-
if (ret)
109+
if (ret) {
110+
pm_runtime_put_sync(hba->dev);
110111
goto out;
112+
}
111113

112114
/* fall through */
113115
case UPIU_TRANSACTION_NOP_OUT:

0 commit comments

Comments
 (0)