提交 a1e17eb0 编写于 作者: D Dinghao Liu 提交者: Martin K. Petersen

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/20200522045932.31795-1-dinghao.liu@zju.edu.cn
Fixes: 74e5e468 (scsi: ufs-bsg: Wake the device before sending raw upiu commands)
Reviewed-by: NAvri Altman <avri.altman@wdc.com>
Signed-off-by: NDinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 b3a9e3b9
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册