Skip to content

Commit

Permalink
[SCSI] lpfc: fix potential NULL pointer dereference in lpfc_sli4_rq_p…
Browse files Browse the repository at this point in the history
…ut()

The dereference to 'put_index' should be moved below the NULL test.

Signed-off-by: Wei Yongjun <[email protected]>
Acked-by: James Smart <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
Wei Yongjun authored and James Bottomley committed Apr 11, 2013
1 parent d4a2618 commit 5a25bf3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/scsi/lpfc/lpfc_sli.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,12 @@ lpfc_sli4_rq_put(struct lpfc_queue *hq, struct lpfc_queue *dq,
struct lpfc_rqe *temp_hrqe;
struct lpfc_rqe *temp_drqe;
struct lpfc_register doorbell;
int put_index = hq->host_index;
int put_index;

/* sanity check on queue memory */
if (unlikely(!hq) || unlikely(!dq))
return -ENOMEM;
put_index = hq->host_index;
temp_hrqe = hq->qe[hq->host_index].rqe;
temp_drqe = dq->qe[dq->host_index].rqe;

Expand Down

0 comments on commit 5a25bf3

Please sign in to comment.