ipmi: Rework SMI registration failure
authorCorey Minyard <cminyard@mvista.com>
Wed, 22 Aug 2018 17:08:13 +0000 (12:08 -0500)
committerCorey Minyard <cminyard@mvista.com>
Fri, 31 Aug 2018 13:42:29 +0000 (08:42 -0500)
commit2512e40e48d21d8bac09f7e91d2c3ceb2d3b50b2
treed3f88ae5767b53c41a4a9d8c4089dc98ac956dd7
parentcd2315d471f45a36cb1329722920d89cd6d3d11f
ipmi: Rework SMI registration failure

There were certain situations where ipmi_register_smi() would
return a failure, but the interface would still be registered
and would need to be unregistered.  This is obviously a bad
design and resulted in an oops in certain failure cases.

If the interface is started up in ipmi_register_smi(), then
an error occurs, shut down the interface there so the
cleanup can be done properly.

Fix the various smi users, too.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Reported-by: Justin Ernst <justin.ernst@hpe.com>
Tested-by: Justin Ernst <justin.ernst@hpe.com>
Cc: Andrew Banman <abanman@hpe.com>
Cc: Russ Anderson <russ.anderson@hpe.com>
Cc: <stable@vger.kernel.org> # 4.18.x
drivers/char/ipmi/ipmi_msghandler.c
drivers/char/ipmi/ipmi_si_intf.c
drivers/char/ipmi/ipmi_ssif.c