[PATCH] ipmi_msghandler: inconsistent spin_lock usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Corey,

I found a inconsistent spin_lock usage in ipmi_smi_msg_received.

Best regards,
 Hironobu Ishii

Signed-off-by: Hironobu Ishii <[email protected]>
------
diff -urNp linux-2.6.14-rc1.org/drivers/char/ipmi/ipmi_msghandler.c linux-2.6.14-rc1/drivers/char/ipmi/ipmi_msghandler.c
--- linux-2.6.14-rc1.org/drivers/char/ipmi/ipmi_msghandler.c 2005-09-13 12:12:09.000000000 +0900
+++ linux-2.6.14-rc1/drivers/char/ipmi/ipmi_msghandler.c 2005-09-22 16:37:48.623052375 +0900
@@ -2620,7 +2620,7 @@ void ipmi_smi_msg_received(ipmi_smi_t spin_lock_irqsave(&(intf->waiting_msgs_lock), flags);
 if (!list_empty(&(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_unlock;
 }
 spin_unlock_irqrestore(&(intf->waiting_msgs_lock), flags);
@@ -2629,9 +2629,9 @@ void ipmi_smi_msg_received(ipmi_smi_t if (rv > 0) {
  /* Could not handle the message now, just add it to a
                   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));
-  spin_unlock(&(intf->waiting_msgs_lock));
+  spin_unlock_irqrestore(&(intf->waiting_msgs_lock), flags);
 } else if (rv == 0) {
  ipmi_free_smi_msg(msg);
 }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux