mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-07 04:09:21 +00:00
[SCSI] lpfc: fix potential NULL pointer dereference in lpfc_sli4_rq_put()
The dereference to 'put_index' should be moved below the NULL test. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:
parent
d4a2618fa7
commit
5a25bf36b7
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue