From: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
To: linuxppc-dev@ozlabs.org, jk@ozlabs.org
Cc: neelegup@linux.vnet.ibm.com
Subject: [PATCH] ipmi/powernv: Fix a minor bug
Date: Wed, 08 Jul 2015 11:57:28 +0530 [thread overview]
Message-ID: <20150708062702.11242.47257.stgit@localhost.localdomain> (raw)
If the OPAL call to receive the ipmi message fails, then we free up the smi
message before returning. But, the driver still holds the reference to old
smi message in the 'cur_msg' which is dangerous if the driver derefernces it
later and it will further block the subsequent ipmi operations. So, to fix
it up, we need to nullify 'cur_msg' in the error case.
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
---
drivers/char/ipmi/ipmi_powernv.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/char/ipmi/ipmi_powernv.c b/drivers/char/ipmi/ipmi_powernv.c
index 9b409c0..08dd38f 100644
--- a/drivers/char/ipmi/ipmi_powernv.c
+++ b/drivers/char/ipmi/ipmi_powernv.c
@@ -143,6 +143,7 @@ static int ipmi_powernv_recv(struct ipmi_smi_powernv *smi)
pr_devel("%s: -> %d (size %lld)\n", __func__,
rc, rc == 0 ? size : 0);
if (rc) {
+ smi->cur_msg = NULL;
spin_unlock_irqrestore(&smi->msg_lock, flags);
ipmi_free_smi_msg(msg);
return 0;
next reply other threads:[~2015-07-08 6:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-08 6:27 Neelesh Gupta [this message]
2015-07-08 10:42 ` ipmi/powernv: Fix a minor bug Michael Ellerman
2015-07-09 10:35 ` Neelesh Gupta
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=20150708062702.11242.47257.stgit@localhost.localdomain \
--to=neelegup@linux.vnet.ibm.com \
--cc=jk@ozlabs.org \
--cc=linuxppc-dev@ozlabs.org \
/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;
as well as URLs for NNTP newsgroup(s).