mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
scsi: ufs-bsg: Fix runtime PM imbalance on error
[ Upstream commit a1e17eb03e69bb61bd1b1a14610436b7b9be12d9 ]
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/20200522045932.31795-1-dinghao.liu@zju.edu.cn
Fixes: 74e5e468b6 (scsi: ufs-bsg: Wake the device before sending raw upiu commands)
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
7c7dd05078
commit
cb5fe511b1
1 changed files with 3 additions and 1 deletions
|
|
@ -106,8 +106,10 @@ static int ufs_bsg_request(struct bsg_job *job)
|
|||
desc_op = bsg_request->upiu_req.qr.opcode;
|
||||
ret = ufs_bsg_alloc_desc_buffer(hba, job, &desc_buff,
|
||||
&desc_len, desc_op);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
pm_runtime_put_sync(hba->dev);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* fall through */
|
||||
case UPIU_TRANSACTION_NOP_OUT:
|
||||
|
|
|
|||
Loading…
Reference in a new issue