ipmi:msghandler: Cancel work cleanly on an error

If an error occurs during startup of an IPMI interface, it may have
scheduled work to run.  The work needs to be canceled before the
interface can be freed.

Reported-by: Nilay Shroff <nilay@linux.ibm.com>
Closes: https://sourceforge.net/p/openipmi/mailman/message/59375605/
Fixes: 62cd145453 ("ipmi:msghandler: Handle error returns from the SMI sender")
Cc: stable@vger.kernel.org # 7.0
Tested-by: Nilay Shroff <nilay@linux.ibm.com>
Signed-off-by: Corey Minyard <corey@minyard.net>
This commit is contained in:
Corey Minyard
2026-08-18 12:49:52 -05:00
parent ed98f8e27a
commit ae84a25365

View File

@@ -3766,6 +3766,7 @@ int ipmi_add_smi(struct module *owner,
list_del(&intf->link);
mutex_unlock(&ipmi_interfaces_mutex);
mutex_unlock(&smi_watchers_mutex);
cancel_work_sync(&intf->smi_work);
kref_put(&intf->refcount, intf_free);
return rv;