Re: [PATCH v2 1/5] scsi: ufs: bsg: Complete the job on error
From: Bean Huo
Date: Sun Oct 18 2026 - 14:22:26 EST
On Thu, 2026-10-15 at 08:18 +0800, Stanley Jhu wrote:
> index 7a66917b3fc0..18c318d78122 100644
> --- a/drivers/ufs/core/ufs_bsg.c
> +++ b/drivers/ufs/core/ufs_bsg.c
> @@ -195,14 +195,12 @@ static int ufs_bsg_request(struct bsg_job *job)
> ufshcd_rpm_put_sync(hba);
> kfree(buff);
> bsg_reply->result = ret;
> - /* complete the job here only if no error */
> - if (ret == 0) {
> + if (ret == 0)
> job->reply_len = rpmb ? sizeof(struct ufs_rpmb_reply) :
> sizeof(struct ufs_bsg_reply);
> - bsg_job_done(job, ret, bsg_reply->reply_payload_rcv_len);
> - }
> + bsg_job_done(job, ret, bsg_reply->reply_payload_rcv_len);
Since the old comment is gone, it's better to add a short one before
bsg_job_done() saying we must always complete the job and return 0?
otherwise a later change could easily bring back either the leak or the double
completion that b13a3539eb2a fixed?
Reviewed-by: Bean Huo <beanhuo@xxxxxxxxxx>
>
> - return ret;
> + return 0;
> }