lkml.org 
[lkml]   [2009]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/5] SCSI: qla2xxx, fix NULL-ptr dereference
Date
Stanse found a NULL-ptr dereference on one fail path in
qla25xx_create_rsp_que. It jumps to que_failed label and
qla25xx_free_rsp_que there dereferences rsp which is NULL.

Return with ENOMEM directly instead.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: James E.J. Bottomley <James.Bottomley@suse.de>
---
drivers/scsi/qla2xxx/qla_mid.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index 42b799a..8b4e723 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -659,7 +659,7 @@ qla25xx_create_rsp_que(struct qla_hw_data *ha, uint16_t options,
if (rsp == NULL) {
qla_printk(KERN_WARNING, ha, "could not allocate memory for"
" response que\n");
- goto que_failed;
+ return -ENOMEM;
}

rsp->length = RESPONSE_ENTRY_CNT_MQ;
--
1.6.4.2


\
 
 \ /
  Last update: 2009-09-23 16:19    [W:0.288 / U:0.540 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site