提交 f3ce6a0e 编写于 作者: C Corey Minyard 提交者: Linus Torvalds

[PATCH] IPMI: Clean up the waiting message queue properly on unload

A wrong function was being used to free a list; this fixes the problem.
Otherwise, an oops at unload time was possible.  But not likely, since you
can't have any users when you unload the modules and it is very hard to get
messages into this queue without users.
Signed-off-by: NCorey Minyard <minyard@acm.org>
Cc: Patrick Schoeller <Patrick.Schoeller@hp.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 13bb7e37
...@@ -376,13 +376,23 @@ static void free_recv_msg_list(struct list_head *q) ...@@ -376,13 +376,23 @@ static void free_recv_msg_list(struct list_head *q)
} }
} }
static void free_smi_msg_list(struct list_head *q)
{
struct ipmi_smi_msg *msg, *msg2;
list_for_each_entry_safe(msg, msg2, q, link) {
list_del(&msg->link);
ipmi_free_smi_msg(msg);
}
}
static void clean_up_interface_data(ipmi_smi_t intf) static void clean_up_interface_data(ipmi_smi_t intf)
{ {
int i; int i;
struct cmd_rcvr *rcvr, *rcvr2; struct cmd_rcvr *rcvr, *rcvr2;
struct list_head list; struct list_head list;
free_recv_msg_list(&intf->waiting_msgs); free_smi_msg_list(&intf->waiting_msgs);
free_recv_msg_list(&intf->waiting_events); free_recv_msg_list(&intf->waiting_events);
/* Wholesale remove all the entries from the list in the /* Wholesale remove all the entries from the list in the
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册