* RE: [2.6 patch] drivers/scsi/dpt_i2o.c: fix a NULL pointer dereference
@ 2005-11-21 13:05 Salyzyn, Mark
0 siblings, 0 replies; 2+ messages in thread
From: Salyzyn, Mark @ 2005-11-21 13:05 UTC (permalink / raw)
To: Adrian Bunk, markus.lidel, James.Bottomley
Cc: linux-scsi, linux-kernel, stable
Cool, good catch. The driver can make a call to this function at runtime
when performing error recovery, not just at driver unload. Applied to
Adaptec Branch of this driver.
Sincerely -- Mark Salyzyn
-----Original Message-----
From: linux-scsi-owner@vger.kernel.org
[mailto:linux-scsi-owner@vger.kernel.org] On Behalf Of Adrian Bunk
Sent: Sunday, November 20, 2005 6:01 PM
To: markus.lidel@shadowconnect.com; James.Bottomley@SteelEye.com
Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org;
stable@kernel.org
Subject: [2.6 patch] drivers/scsi/dpt_i2o.c: fix a NULL pointer
dereference
The Coverity checker spotted this obvious NULL pointer dereference.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
drivers/scsi/dpt_i2o.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
--- linux-2.6.15-rc1-mm2-full/drivers/scsi/dpt_i2o.c.old
2005-11-20 22:13:37.000000000 +0100
+++ linux-2.6.15-rc1-mm2-full/drivers/scsi/dpt_i2o.c 2005-11-20
22:16:57.000000000 +0100
@@ -816,7 +816,7 @@
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 @@
}
/* 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;
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org More majordomo info
at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread* [2.6 patch] drivers/scsi/dpt_i2o.c: fix a NULL pointer dereference
@ 2005-11-20 23:00 Adrian Bunk
0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2005-11-20 23:00 UTC (permalink / raw)
To: markus.lidel, James.Bottomley; +Cc: linux-scsi, linux-kernel, stable
The Coverity checker spotted this obvious NULL pointer dereference.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
drivers/scsi/dpt_i2o.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
--- linux-2.6.15-rc1-mm2-full/drivers/scsi/dpt_i2o.c.old 2005-11-20 22:13:37.000000000 +0100
+++ linux-2.6.15-rc1-mm2-full/drivers/scsi/dpt_i2o.c 2005-11-20 22:16:57.000000000 +0100
@@ -816,7 +816,7 @@
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 @@
}
/* 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;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-11-21 13:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-21 13:05 [2.6 patch] drivers/scsi/dpt_i2o.c: fix a NULL pointer dereference Salyzyn, Mark
-- strict thread matches above, loose matches on Subject: below --
2005-11-20 23:00 Adrian Bunk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®