Commit b248df30 authored by Hugh Daschbach's avatar Hugh Daschbach Committed by James Bottomley

[SCSI] libfc: Don't assume response request present.

Fix NULL pointer dereference crash occurs in fc_lport_bsg_request()
for bsg requests that do not contain a response request.
Specifically, FC_BSG_HST_ADD_RPORT and FC_BSG_HST_DEL_RPORT bsg
requests are not guaranteed to include a response request.
Signed-off-by: default avatarHugh Daschbach <hdasch@broadcom.com>
Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 3b709150
...@@ -1800,7 +1800,8 @@ int fc_lport_bsg_request(struct fc_bsg_job *job) ...@@ -1800,7 +1800,8 @@ int fc_lport_bsg_request(struct fc_bsg_job *job)
u32 did; u32 did;
job->reply->reply_payload_rcv_len = 0; job->reply->reply_payload_rcv_len = 0;
rsp->resid_len = job->reply_payload.payload_len; if (rsp)
rsp->resid_len = job->reply_payload.payload_len;
mutex_lock(&lport->lp_mutex); mutex_lock(&lport->lp_mutex);
......
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