All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] [SCSI] lpfc 8.3.36: fix potential NULL pointer dereference in lpfc_sli4_rq_put()
@ 2012-12-02 13:33 Wei Yongjun
  2012-12-06 15:46 ` James Smart
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2012-12-02 13:33 UTC (permalink / raw)
  To: james.smart, JBottomley; +Cc: yongjun_wei, linux-scsi

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 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;
 



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] [SCSI] lpfc 8.3.36: fix potential NULL pointer dereference in lpfc_sli4_rq_put()
  2012-12-02 13:33 [PATCH -next] [SCSI] lpfc 8.3.36: fix potential NULL pointer dereference in lpfc_sli4_rq_put() Wei Yongjun
@ 2012-12-06 15:46 ` James Smart
  2013-03-18 18:08   ` James Smart
  0 siblings, 1 reply; 3+ messages in thread
From: James Smart @ 2012-12-06 15:46 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: JBottomley, yongjun_wei, linux-scsi

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

Thanks

-- james s


On 12/2/2012 8:33 AM, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> The dereference to 'put_index' should be moved below the NULL test.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>   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;
>   
>
>
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] [SCSI] lpfc 8.3.36: fix potential NULL pointer dereference in lpfc_sli4_rq_put()
  2012-12-06 15:46 ` James Smart
@ 2013-03-18 18:08   ` James Smart
  0 siblings, 0 replies; 3+ messages in thread
From: James Smart @ 2013-03-18 18:08 UTC (permalink / raw)
  To: James Bottomley; +Cc: James.Smart, Wei Yongjun, yongjun_wei, linux-scsi

James,

Can you please merge this fix into scsi git for merging into 3.9 ?

-- james s



On 12/6/2012 10:46 AM, James Smart wrote:
> Acked-By: James Smart  <james.smart@emulex.com>
>
> Thanks
>
> -- james s
>
>
> On 12/2/2012 8:33 AM, Wei Yongjun wrote:
>> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>>
>> The dereference to 'put_index' should be moved below the NULL test.
>>
>> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>> ---
>>   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@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-18 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-02 13:33 [PATCH -next] [SCSI] lpfc 8.3.36: fix potential NULL pointer dereference in lpfc_sli4_rq_put() Wei Yongjun
2012-12-06 15:46 ` James Smart
2013-03-18 18:08   ` James Smart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.