diff options
author | Adrian Bunk <bunk@stusta.de> | 2005-11-26 18:36:37 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-27 23:23:46 -0500 |
commit | 458af5439fe7ae7d95ca14106844e61f0795166c (patch) | |
tree | 1e8504d2a91579756c89ef2d65ebd526f973cde8 /drivers/scsi | |
parent | 2012a116d9e6803fb072d0cfe1aae0cc4e6d6416 (diff) |
[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>
Acked-by: Mark Salyzyn <mark_salyzyn@adaptec.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/dpt_i2o.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index c28e3aea1c3..418fc7b896a 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
@@ -816,7 +816,7 @@ static int adpt_hba_reset(adpt_hba* pHba) | |||
816 | static void adpt_i2o_sys_shutdown(void) | 816 | static void adpt_i2o_sys_shutdown(void) |
817 | { | 817 | { |
818 | adpt_hba *pHba, *pNext; | 818 | adpt_hba *pHba, *pNext; |
819 | struct adpt_i2o_post_wait_data *p1, *p2; | 819 | struct adpt_i2o_post_wait_data *p1, *old; |
820 | 820 | ||
821 | printk(KERN_INFO"Shutting down Adaptec I2O controllers.\n"); | 821 | printk(KERN_INFO"Shutting down Adaptec I2O controllers.\n"); |
822 | printk(KERN_INFO" This could take a few minutes if there are many devices attached\n"); | 822 | 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) | |||
830 | } | 830 | } |
831 | 831 | ||
832 | /* Remove any timedout entries from the wait queue. */ | 832 | /* Remove any timedout entries from the wait queue. */ |
833 | p2 = NULL; | ||
834 | // spin_lock_irqsave(&adpt_post_wait_lock, flags); | 833 | // spin_lock_irqsave(&adpt_post_wait_lock, flags); |
835 | /* Nothing should be outstanding at this point so just | 834 | /* Nothing should be outstanding at this point so just |
836 | * free them | 835 | * free them |
837 | */ | 836 | */ |
838 | for(p1 = adpt_post_wait_queue; p1; p2 = p1, p1 = p2->next) { | 837 | for(p1 = adpt_post_wait_queue; p1;) { |
839 | kfree(p1); | 838 | old = p1; |
839 | p1 = p1->next; | ||
840 | kfree(old); | ||
840 | } | 841 | } |
841 | // spin_unlock_irqrestore(&adpt_post_wait_lock, flags); | 842 | // spin_unlock_irqrestore(&adpt_post_wait_lock, flags); |
842 | adpt_post_wait_queue = NULL; | 843 | adpt_post_wait_queue = NULL; |