lkml.org 
[lkml]   [2005]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[02/13] qla2xxx: Correct handling of fc_remote_port_add() failure case.
-stable review patch.  If anyone has any objections, please let us know.

------------------

Correct handling of fc_remote_port_add() failure case.

Immediately return if fc_remote_port_add() fails to allocate
resources for the rport. Original code would result in NULL
pointer dereference upon failure.

Reported-by: Michael Reed <mdr@sgi.com>

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/qla2xxx/qla_init.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)

--- linux-2.6.12.3.orig/drivers/scsi/qla2xxx/qla_init.c 2005-07-28 11:17:01.000000000 -0700
+++ linux-2.6.12.3/drivers/scsi/qla2xxx/qla_init.c 2005-07-28 11:17:08.000000000 -0700
@@ -1914,9 +1914,11 @@
rport_ids.roles |= FC_RPORT_ROLE_FCP_TARGET;

fcport->rport = rport = fc_remote_port_add(ha->host, 0, &rport_ids);
- if (!rport)
+ if (!rport) {
qla_printk(KERN_WARNING, ha,
"Unable to allocate fc remote port!\n");
+ return;
+ }

if (rport->scsi_target_id != -1 && rport->scsi_target_id < MAX_TARGETS)
fcport->os_target_id = rport->scsi_target_id;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-08-03 08:57    [W:0.099 / U:0.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site