mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: minyard@acm.org
To: Meelis Roos <mroos@linux.ee>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>,
	openipmi-developer@lists.sourceforge.net,
	Corey Minyard <cminyard@mvista.com>
Subject: [PATCH] ipmi: Cleanup oops on initialization failure
Date: Wed, 20 Jun 2018 07:26:46 -0500	[thread overview]
Message-ID: <1529497606-3857-1-git-send-email-minyard@acm.org> (raw)
In-Reply-To: <alpine.LRH.2.21.1806191553040.28622@math.ut.ee>

From: Corey Minyard <cminyard@mvista.com>

Commit 93c303d2045b3 "ipmi_si: Clean up shutdown a bit" didn't
copy the behavior of the cleanup in one spot, it needed to
check for a non-NULL interface before cleaning it up.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
---

This patch should fix the issue.

BTW, can you send me at least the IPMI portion of the output of
dmidecode for your machine?  I have seen a lot of these where the
address in the SMBIOS tables is incorrect, and I'm wondering if
it's something in the driver, or if it's really the tables that
are bad.

Thanks for reporting this.  On your tested-by I'll send this up
to Linus.

-corey

 drivers/char/ipmi/ipmi_si_intf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 3d0add6..a5987f8 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -2088,8 +2088,10 @@ static int try_smi_init(struct smi_info *new_smi)
 	return 0;
 
 out_err:
-	ipmi_unregister_smi(new_smi->intf);
-	new_smi->intf = NULL;
+	if (new_smi->intf) {
+		ipmi_unregister_smi(new_smi->intf);
+		new_smi->intf = NULL;
+	}
 
 	kfree(init_name);
 
-- 
2.7.4


  reply	other threads:[~2018-06-20 12:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-19 12:58 iomi-si UBSAN warning and NULL pointer dereference Meelis Roos
2018-06-20 12:26 ` minyard [this message]
2018-06-20 14:26   ` [PATCH] ipmi: Cleanup oops on initialization failure Meelis Roos
2018-06-20 23:00     ` Corey Minyard
2018-06-21  6:47       ` Meelis Roos
2018-06-21 20:16         ` Corey Minyard

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=1529497606-3857-1-git-send-email-minyard@acm.org \
    --to=minyard@acm.org \
    --cc=cminyard@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mroos@linux.ee \
    --cc=openipmi-developer@lists.sourceforge.net \
    /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

Powered by JetHome