Re: [PATCH -next] [SCSI] lpfc 8.3.36: fix potential NULL pointer dereference in lpfc_sli4_rq_put()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Acked-By:   James Smart  <james.smart@xxxxxxxxxx>

Thanks

-- james s


On 12/2/2012 8:33 AM, Wei Yongjun wrote:
From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>

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

Signed-off-by: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
---
  drivers/scsi/lpfc/lpfc_sli.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 624eab3..a9a7fd7 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -431,11 +431,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;




--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux