summaryrefslogtreecommitdiff
path: root/drivers/char/ipmi/ipmi_si_intf.c
diff options
context:
space:
mode:
authorCorey Minyard <cminyard@mvista.com>2018-06-20 15:19:01 +0300
committerCorey Minyard <cminyard@mvista.com>2018-06-25 02:11:38 +0300
commit2068db53b6337f8c6c7bcd07dea0b5e82b1a1a02 (patch)
tree00a6bbd62f616ac557e1f8d39b81a7a8f66a09b6 /drivers/char/ipmi/ipmi_si_intf.c
parent9ffc59d57228d74809700be6f7ecb1db10292f05 (diff)
downloadlinux-2068db53b6337f8c6c7bcd07dea0b5e82b1a1a02.tar.xz
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>
Diffstat (limited to 'drivers/char/ipmi/ipmi_si_intf.c')
-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 ad353be871bf..90ec010bffbd 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);