summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorey Minyard <cminyard@mvista.com>2018-06-20 07:19:01 -0500
committerCorey Minyard <cminyard@mvista.com>2018-06-24 18:11:38 -0500
commit2068db53b6337f8c6c7bcd07dea0b5e82b1a1a02 (patch)
tree00a6bbd62f616ac557e1f8d39b81a7a8f66a09b6
parent9ffc59d57228d74809700be6f7ecb1db10292f05 (diff)
downloadop-kernel-dev-2068db53b6337f8c6c7bcd07dea0b5e82b1a1a02.zip
op-kernel-dev-2068db53b6337f8c6c7bcd07dea0b5e82b1a1a02.tar.gz
ipmi: Cleanup oops on initialization failure
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. Reported-by: Meelis Roos <mroos@linux.ee> Signed-off-by: Corey Minyard <cminyard@mvista.com> Tested-by: Meelis Roos <mroos@linux.ee>
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index ad353be..90ec010 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);
OpenPOWER on IntegriCloud