diff options
| author | Corey Minyard <corey@minyard.net> | 2025-03-21 16:46:02 -0500 |
|---|---|---|
| committer | Corey Minyard <corey@minyard.net> | 2025-05-07 17:25:48 -0500 |
| commit | 8871e77ec73b0b6da6d80677ea49e3f462d03fda (patch) | |
| tree | b8c0addd9b595176ce2da8875b247ef1ce6d8d2d | |
| parent | 60afcc429c5bc8ca364b6cdf057b69b66b8ebd76 (diff) | |
ipmi:msghandler: Shut down lower layer first at unregister
This makes sure any outstanding messages are returned to the user before
the interface is cleaned up.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
| -rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 75f124c273d9..d6f3fc1f39e0 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c @@ -3738,7 +3738,13 @@ void ipmi_unregister_smi(struct ipmi_smi *intf) list_del(&intf->link); mutex_unlock(&ipmi_interfaces_mutex); - /* At this point no users can be added to the interface. */ + /* + * At this point no users can be added to the interface and no + * new messages can be sent. + */ + + if (intf->handlers->shutdown) + intf->handlers->shutdown(intf->send_info); device_remove_file(intf->si_dev, &intf->nr_msgs_devattr); device_remove_file(intf->si_dev, &intf->nr_users_devattr); @@ -3761,9 +3767,6 @@ void ipmi_unregister_smi(struct ipmi_smi *intf) } mutex_unlock(&intf->users_mutex); - if (intf->handlers->shutdown) - intf->handlers->shutdown(intf->send_info); - cleanup_smi_msgs(intf); ipmi_bmc_unregister(intf); |
