Unverified Commit 04fc57a7 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15762 scsi: ufs: core: bsg: Fix crash when arpmb command fails

parents f5dce47f d8191b7f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -194,10 +194,12 @@ static int ufs_bsg_request(struct bsg_job *job)
	ufshcd_rpm_put_sync(hba);
	kfree(buff);
	bsg_reply->result = ret;
	job->reply_len = !rpmb ? sizeof(struct ufs_bsg_reply) : sizeof(struct ufs_rpmb_reply);
	/* 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);
	}

	return ret;
}