diff options
author | David Barksdale <amatus@ocgnet.org> | 2007-01-30 17:36:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-30 19:01:36 -0500 |
commit | 41c57a87183a7c458d86f78966d69d4bf18ea0b7 (patch) | |
tree | 8efc83537ecc63a49cd823133f10f003b1efa4ee /drivers/char/ipmi | |
parent | fa8609da993b04dc2dd762173a6d0ab1a192e256 (diff) |
[PATCH] IPMI: fix timeout list handling
Fix a dangling pointer bug in ipmi_timeout_handler. A list of timedout
messages is not re-initialized before reuse, causing the head of the list
to point to freed memory.
Signed-off-by: David Barksdale <amatus@ocgnet.org>
Signed-off-by: Corey Minyard <minyard@acm.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/ipmi')
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 4e4691a53890..53582b53da95 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -3649,8 +3649,6 @@ static void ipmi_timeout_handler(long timeout_period) | |||
3649 | unsigned long flags; | 3649 | unsigned long flags; |
3650 | int i; | 3650 | int i; |
3651 | 3651 | ||
3652 | INIT_LIST_HEAD(&timeouts); | ||
3653 | |||
3654 | rcu_read_lock(); | 3652 | rcu_read_lock(); |
3655 | list_for_each_entry_rcu(intf, &ipmi_interfaces, link) { | 3653 | list_for_each_entry_rcu(intf, &ipmi_interfaces, link) { |
3656 | /* See if any waiting messages need to be processed. */ | 3654 | /* See if any waiting messages need to be processed. */ |
@@ -3671,6 +3669,7 @@ static void ipmi_timeout_handler(long timeout_period) | |||
3671 | /* Go through the seq table and find any messages that | 3669 | /* Go through the seq table and find any messages that |
3672 | have timed out, putting them in the timeouts | 3670 | have timed out, putting them in the timeouts |
3673 | list. */ | 3671 | list. */ |
3672 | INIT_LIST_HEAD(&timeouts); | ||
3674 | spin_lock_irqsave(&intf->seq_lock, flags); | 3673 | spin_lock_irqsave(&intf->seq_lock, flags); |
3675 | for (i = 0; i < IPMI_IPMB_NUM_SEQ; i++) | 3674 | for (i = 0; i < IPMI_IPMB_NUM_SEQ; i++) |
3676 | check_msg_timeout(intf, &(intf->seq_table[i]), | 3675 | check_msg_timeout(intf, &(intf->seq_table[i]), |