Skip to content

Commit

Permalink
[SCSI] libfc: Don't assume response request present.
Browse files Browse the repository at this point in the history
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: Hugh Daschbach <hdasch@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Hugh Daschbach authored and James Bottomley committed Feb 17, 2010
1 parent 3b70915 commit b248df3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/scsi/libfc/fc_lport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,8 @@ int fc_lport_bsg_request(struct fc_bsg_job *job)
u32 did;

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);

Expand Down

0 comments on commit b248df3

Please sign in to comment.