mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-16 07:35:14 +00:00
[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>
This commit is contained in:
parent
2012a116d9
commit
458af5439f
1 changed files with 5 additions and 4 deletions
|
@ -816,7 +816,7 @@ static int adpt_hba_reset(adpt_hba* pHba)
|
||||||
static void adpt_i2o_sys_shutdown(void)
|
static void adpt_i2o_sys_shutdown(void)
|
||||||
{
|
{
|
||||||
adpt_hba *pHba, *pNext;
|
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"Shutting down Adaptec I2O controllers.\n");
|
||||||
printk(KERN_INFO" This could take a few minutes if there are many devices attached\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. */
|
/* Remove any timedout entries from the wait queue. */
|
||||||
p2 = NULL;
|
|
||||||
// spin_lock_irqsave(&adpt_post_wait_lock, flags);
|
// spin_lock_irqsave(&adpt_post_wait_lock, flags);
|
||||||
/* Nothing should be outstanding at this point so just
|
/* Nothing should be outstanding at this point so just
|
||||||
* free them
|
* free them
|
||||||
*/
|
*/
|
||||||
for(p1 = adpt_post_wait_queue; p1; p2 = p1, p1 = p2->next) {
|
for(p1 = adpt_post_wait_queue; p1;) {
|
||||||
kfree(p1);
|
old = p1;
|
||||||
|
p1 = p1->next;
|
||||||
|
kfree(old);
|
||||||
}
|
}
|
||||||
// spin_unlock_irqrestore(&adpt_post_wait_lock, flags);
|
// spin_unlock_irqrestore(&adpt_post_wait_lock, flags);
|
||||||
adpt_post_wait_queue = NULL;
|
adpt_post_wait_queue = NULL;
|
||||||
|
|
Loading…
Reference in a new issue