Skip to content

Commit

Permalink
ipmi: Cleanup oops on initialization failure
Browse files Browse the repository at this point in the history
Commit 93c303d "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 <[email protected]>
Signed-off-by: Corey Minyard <[email protected]>
Tested-by: Meelis Roos <[email protected]>
  • Loading branch information
cminyard committed Jun 24, 2018
1 parent 9ffc59d commit 2068db5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/char/ipmi/ipmi_si_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 2068db5

Please sign in to comment.