Commit 6db51abb authored by James Smart's avatar James Smart Committed by Martin K. Petersen

scsi: lpfc: Fix upcall to bsg done in non-success cases

The scsi transport fc bsg interface does not expect the bsg_job_done()
callback to be done if the bsg request call returns failure. Several of the
HST_VENDOR cases in the driver unconditionally call bsg_job_done()
regardless of the returning value.

Fix the code to only call bsg_job_done() if the call to lpfc_bsg_request()
will return success.
Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 07b1b914
...@@ -5448,7 +5448,9 @@ lpfc_bsg_get_ras_config(struct bsg_job *job) ...@@ -5448,7 +5448,9 @@ lpfc_bsg_get_ras_config(struct bsg_job *job)
bsg_reply->result = rc; bsg_reply->result = rc;
/* complete the job back to userspace */ /* complete the job back to userspace */
bsg_job_done(job, bsg_reply->result, bsg_reply->reply_payload_rcv_len); if (!rc)
bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rc; return rc;
} }
...@@ -5527,8 +5529,9 @@ lpfc_bsg_set_ras_config(struct bsg_job *job) ...@@ -5527,8 +5529,9 @@ lpfc_bsg_set_ras_config(struct bsg_job *job)
bsg_reply->result = rc; bsg_reply->result = rc;
/* complete the job back to userspace */ /* complete the job back to userspace */
bsg_job_done(job, bsg_reply->result, if (!rc)
bsg_reply->reply_payload_rcv_len); bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rc; return rc;
} }
...@@ -5588,7 +5591,9 @@ lpfc_bsg_get_ras_lwpd(struct bsg_job *job) ...@@ -5588,7 +5591,9 @@ lpfc_bsg_get_ras_lwpd(struct bsg_job *job)
bsg_reply->result = rc; bsg_reply->result = rc;
/* complete the job back to userspace */ /* complete the job back to userspace */
bsg_job_done(job, bsg_reply->result, bsg_reply->reply_payload_rcv_len); if (!rc)
bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rc; return rc;
} }
...@@ -5670,7 +5675,9 @@ lpfc_bsg_get_ras_fwlog(struct bsg_job *job) ...@@ -5670,7 +5675,9 @@ lpfc_bsg_get_ras_fwlog(struct bsg_job *job)
ras_job_error: ras_job_error:
bsg_reply->result = rc; bsg_reply->result = rc;
bsg_job_done(job, bsg_reply->result, bsg_reply->reply_payload_rcv_len); if (!rc)
bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rc; return rc;
} }
...@@ -5741,8 +5748,9 @@ lpfc_get_trunk_info(struct bsg_job *job) ...@@ -5741,8 +5748,9 @@ lpfc_get_trunk_info(struct bsg_job *job)
phba->sli4_hba.link_state.logical_speed / 1000; phba->sli4_hba.link_state.logical_speed / 1000;
job_error: job_error:
bsg_reply->result = rc; bsg_reply->result = rc;
bsg_job_done(job, bsg_reply->result, if (!rc)
bsg_reply->reply_payload_rcv_len); bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment