]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Add NULL ptr deref fix from Adrian Bunk (Coverity fix)
authorChris Wright <chrisw@osdl.org>
Mon, 28 Nov 2005 22:42:44 +0000 (14:42 -0800)
committerChris Wright <chrisw@osdl.org>
Mon, 28 Nov 2005 22:42:44 +0000 (14:42 -0800)
queue/dpt_i2o-fix-a-null-pointer-deref.patch [new file with mode: 0644]
queue/series [new file with mode: 0644]

diff --git a/queue/dpt_i2o-fix-a-null-pointer-deref.patch b/queue/dpt_i2o-fix-a-null-pointer-deref.patch
new file mode 100644 (file)
index 0000000..e5c1499
--- /dev/null
@@ -0,0 +1,51 @@
+From stable-bounces@linux.kernel.org  Mon Nov 28 03:43:56 2005
+Date: Mon, 28 Nov 2005 12:43:41 +0100
+From: Adrian Bunk <bunk@stusta.de>
+To: stable@kernel.org
+Cc: 
+Subject: drivers/scsi/dpt_i2o.c: fix a NULL pointer dereference
+
+The Coverity checker spotted this obvious NULL pointer dereference.
+
+This patch was already included in Linus' tree.
+
+
+Signed-off-by: Adrian Bunk <bunk@stusta.de>
+Acked-by: Mark Salyzyn <mark_salyzyn@adaptec.com>
+Signed-off-by: Chris Wright <chrisw@osdl.org>
+---
+
+ drivers/scsi/dpt_i2o.c |    9 +++++----
+ 1 files changed, 5 insertions(+), 4 deletions(-)
+
+Index: linux-2.6.14.y/drivers/scsi/dpt_i2o.c
+===================================================================
+--- linux-2.6.14.y.orig/drivers/scsi/dpt_i2o.c
++++ linux-2.6.14.y/drivers/scsi/dpt_i2o.c
+@@ -816,7 +816,7 @@ static int adpt_hba_reset(adpt_hba* pHba
+ static void adpt_i2o_sys_shutdown(void)
+ {
+       adpt_hba *pHba, *pNext;
+-      struct adpt_i2o_post_wait_data *p1, *p2;
++      struct adpt_i2o_post_wait_data *p1, *old;
+        printk(KERN_INFO"Shutting down Adaptec I2O controllers.\n");
+        printk(KERN_INFO"   This could take a few minutes if there are many devices attached\n");
+@@ -830,13 +830,14 @@ static void adpt_i2o_sys_shutdown(void)
+       }
+       /* Remove any timedout entries from the wait queue.  */
+-      p2 = NULL;
+ //    spin_lock_irqsave(&adpt_post_wait_lock, flags);
+       /* Nothing should be outstanding at this point so just
+        * free them 
+        */
+-      for(p1 = adpt_post_wait_queue; p1; p2 = p1, p1 = p2->next) {
+-              kfree(p1);
++      for(p1 = adpt_post_wait_queue; p1;) {
++              old = p1;
++              p1 = p1->next;
++              kfree(old);
+       }
+ //    spin_unlock_irqrestore(&adpt_post_wait_lock, flags);
+       adpt_post_wait_queue = NULL;
diff --git a/queue/series b/queue/series
new file mode 100644 (file)
index 0000000..c09e81b
--- /dev/null
@@ -0,0 +1 @@
+dpt_i2o-fix-a-null-pointer-deref.patch