Skip to content

Commit 8871e77

Browse files
committed
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 <[email protected]>
1 parent 60afcc4 commit 8871e77

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/char/ipmi/ipmi_msghandler.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3738,7 +3738,13 @@ void ipmi_unregister_smi(struct ipmi_smi *intf)
37383738
list_del(&intf->link);
37393739
mutex_unlock(&ipmi_interfaces_mutex);
37403740

3741-
/* At this point no users can be added to the interface. */
3741+
/*
3742+
* At this point no users can be added to the interface and no
3743+
* new messages can be sent.
3744+
*/
3745+
3746+
if (intf->handlers->shutdown)
3747+
intf->handlers->shutdown(intf->send_info);
37423748

37433749
device_remove_file(intf->si_dev, &intf->nr_msgs_devattr);
37443750
device_remove_file(intf->si_dev, &intf->nr_users_devattr);
@@ -3761,9 +3767,6 @@ void ipmi_unregister_smi(struct ipmi_smi *intf)
37613767
}
37623768
mutex_unlock(&intf->users_mutex);
37633769

3764-
if (intf->handlers->shutdown)
3765-
intf->handlers->shutdown(intf->send_info);
3766-
37673770
cleanup_smi_msgs(intf);
37683771

37693772
ipmi_bmc_unregister(intf);

0 commit comments

Comments
 (0)