提交 177294d1 编写于 作者: H Hironobu Ishii 提交者: Linus Torvalds

[PATCH] ipmi: fix inconsistent spinlock usage

Part of a patch was accidentally reverted, this corrects an
inconsistent spinlock use in the IPMI message handler.
Signed-off-by: NHironobu Ishii <hishii@soft.fujitsu.com>
Signed-off-by: NCorey Minyard <minyard@acm.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 9b80b11c
...@@ -2648,7 +2648,7 @@ void ipmi_smi_msg_received(ipmi_smi_t intf, ...@@ -2648,7 +2648,7 @@ void ipmi_smi_msg_received(ipmi_smi_t intf,
spin_lock_irqsave(&intf->waiting_msgs_lock, flags); spin_lock_irqsave(&intf->waiting_msgs_lock, flags);
if (!list_empty(&intf->waiting_msgs)) { if (!list_empty(&intf->waiting_msgs)) {
list_add_tail(&msg->link, &intf->waiting_msgs); list_add_tail(&msg->link, &intf->waiting_msgs);
spin_unlock(&intf->waiting_msgs_lock); spin_unlock_irqrestore(&intf->waiting_msgs_lock, flags);
goto out; goto out;
} }
spin_unlock_irqrestore(&intf->waiting_msgs_lock, flags); spin_unlock_irqrestore(&intf->waiting_msgs_lock, flags);
...@@ -2657,9 +2657,9 @@ void ipmi_smi_msg_received(ipmi_smi_t intf, ...@@ -2657,9 +2657,9 @@ void ipmi_smi_msg_received(ipmi_smi_t intf,
if (rv > 0) { if (rv > 0) {
/* Could not handle the message now, just add it to a /* Could not handle the message now, just add it to a
list to handle later. */ list to handle later. */
spin_lock(&intf->waiting_msgs_lock); spin_lock_irqsave(&intf->waiting_msgs_lock, flags);
list_add_tail(&msg->link, &intf->waiting_msgs); list_add_tail(&msg->link, &intf->waiting_msgs);
spin_unlock(&intf->waiting_msgs_lock); spin_unlock_irqrestore(&intf->waiting_msgs_lock, flags);
} else if (rv == 0) { } else if (rv == 0) {
ipmi_free_smi_msg(msg); ipmi_free_smi_msg(msg);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册