diff options
author | Corey Minyard <cminyard@mvista.com> | 2018-06-20 07:19:01 -0500 |
---|---|---|
committer | Corey Minyard <cminyard@mvista.com> | 2018-06-24 18:11:38 -0500 |
commit | 2068db53b6337f8c6c7bcd07dea0b5e82b1a1a02 (patch) | |
tree | 00a6bbd62f616ac557e1f8d39b81a7a8f66a09b6 /drivers/char/ipmi | |
parent | 9ffc59d57228d74809700be6f7ecb1db10292f05 (diff) |
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')
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 6 |
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); |