linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qla2xxx: Fix Null ptr dereference in fail path in queue create code
@ 2009-09-25  7:45 Anirban Chakraborty
  2009-09-25  7:48 ` Jiri Slaby
  0 siblings, 1 reply; 2+ messages in thread
From: Anirban Chakraborty @ 2009-09-25  7:45 UTC (permalink / raw)
  To: Jiri Slaby, James.Bottomley; +Cc: linux-scsi, Andrew Vasquez

Current code jumps to fail path in queue create functions and there it invokes 
the queue free call with a (NULL) pointer to the queue which could not be 
allocated. Fix it by returning ENOMEM directly without invoking the queue free 
call.

Signed-off-by Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
---
 drivers/scsi/qla2xxx/qla_mid.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index 42b799a..a588152 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -568,7 +568,7 @@ qla25xx_create_req_que(struct qla_hw_data *ha, uint16_t options,
 	if (req == NULL) {
 		qla_printk(KERN_WARNING, ha, "could not allocate memory"
 			"for request que\n");
-		goto que_failed;
+		return ENOMEM;
 	}
 
 	req->length = REQUEST_ENTRY_CNT_24XX;
@@ -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.2


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

end of thread, other threads:[~2009-09-25  8:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-25  7:45 [PATCH] qla2xxx: Fix Null ptr dereference in fail path in queue create code Anirban Chakraborty
2009-09-25  7:48 ` Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).