mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Hironobu Ishii" <hishii@soft.fujitsu.com>
To: <minyard@mvista.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH] ipmi_msghandler: inconsistent spin_lock usage
Date: Thu, 22 Sep 2005 22:24:27 +0900	[thread overview]
Message-ID: <030801c5bf79$114d3df0$ce677c0a@CARREN> (raw)

Hi Corey,

I found a inconsistent spin_lock usage in ipmi_smi_msg_received.

Best regards,
  Hironobu Ishii

Signed-off-by: Hironobu Ishii <hishii@soft.fujitsu.com>
------
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);
  }


                 reply	other threads:[~2005-09-22 13:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='030801c5bf79$114d3df0$ce677c0a@CARREN' \
    --to=hishii@soft.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minyard@mvista.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®