From 8c799701d31a8a2293b16e17227fb75340cb27a5 Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Thu, 14 Jul 2005 17:39:53 -0700 Subject: [PATCH] Add qla2xxx fix from Andrew Vasquez and rocket.c ldisc fix from Michal Ostrowski (sent via akpm). Also add series file for this new batch. --- ...a2xxx-fc_remote_port_add-failure-fix.patch | 34 +++++++++++++++ queue/rocket_c-fix-ldisc-ref-count.patch | 42 +++++++++++++++++++ queue/series | 3 ++ 3 files changed, 79 insertions(+) create mode 100644 queue/qla2xxx-fc_remote_port_add-failure-fix.patch create mode 100644 queue/rocket_c-fix-ldisc-ref-count.patch create mode 100644 queue/series diff --git a/queue/qla2xxx-fc_remote_port_add-failure-fix.patch b/queue/qla2xxx-fc_remote_port_add-failure-fix.patch new file mode 100644 index 00000000000..d278b392de0 --- /dev/null +++ b/queue/qla2xxx-fc_remote_port_add-failure-fix.patch @@ -0,0 +1,34 @@ +From stable-bounces@linux.kernel.org Thu Jul 14 16:42:44 2005 +Date: Thu, 14 Jul 2005 16:40:04 -0700 +From: Andrew Vasquez +To: stable@kernel.org +Cc: Andrew Vasquez , Michael Reed +Subject: [PATCH] qla2xxx: Correct handling of fc_remote_port_add() failure case. + +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 + +Signed-off-by: Andrew Vasquez +Signed-off-by: Chris Wright +--- + +--- linux-2.6.12.2/drivers/scsi/qla2xxx/qla_init.c.orig 2005-07-14 15:14:14.000000000 -0700 ++++ linux-2.6.12.2/drivers/scsi/qla2xxx/qla_init.c 2005-07-14 15:14:54.000000000 -0700 +@@ -1914,9 +1914,11 @@ qla2x00_reg_remote_port(scsi_qla_host_t + 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; diff --git a/queue/rocket_c-fix-ldisc-ref-count.patch b/queue/rocket_c-fix-ldisc-ref-count.patch new file mode 100644 index 00000000000..9cff972da4b --- /dev/null +++ b/queue/rocket_c-fix-ldisc-ref-count.patch @@ -0,0 +1,42 @@ +From stable-bounces@linux.kernel.org Thu Jul 14 16:54:10 2005 +To: stable@kernel.org +From: akpm@osdl.org +Date: Thu, 14 Jul 2005 16:46:26 -0700 +Cc: akpm@osdl.org, mostrows@watson.ibm.com +Subject: [patch] rocket.c: Fix ldisc ref count handling + +From: Michal Ostrowski + +If bailing out because there is nothing to receive in rp_do_receive(), +tty_ldisc_deref is not called. Failure to do so increases the ref count=20 +and causes release_dev() to hang since it can't get the ref count to 0. + +Signed-off-by: Michal Ostrowski +Signed-off-by: Andrew Morton +Signed-off-by: Chris Wright +--- + + drivers/char/rocket.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletion(-) + +Index: linux-2.6.12.y/drivers/char/rocket.c +=================================================================== +--- linux-2.6.12.y.orig/drivers/char/rocket.c ++++ linux-2.6.12.y/drivers/char/rocket.c +@@ -277,7 +277,7 @@ static void rp_do_receive(struct r_port + ToRecv = space; + + if (ToRecv <= 0) +- return; ++ goto done; + + /* + * if status indicates there are errored characters in the +@@ -359,6 +359,7 @@ static void rp_do_receive(struct r_port + } + /* Push the data up to the tty layer */ + ld->receive_buf(tty, tty->flip.char_buf, tty->flip.flag_buf, count); ++done: + tty_ldisc_deref(ld); + } + diff --git a/queue/series b/queue/series new file mode 100644 index 00000000000..9911b90974f --- /dev/null +++ b/queue/series @@ -0,0 +1,3 @@ +kbuild-fix-tags-problem-with-o.patch +qla2xxx-fc_remote_port_add-failure-fix.patch +rocket_c-fix-ldisc-ref-count.patch -- 2.47.3