Messages in this thread Patch in this message | | | Date | Tue, 2 Aug 2005 23:48:38 -0700 | From | Chris Wright <> | 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/
| |