Skip to content

Commit f2a3116

Browse files
committed
ipmi:msghandler: Don't check for shutdown when returning responses
The lower level interface shouldn't attempt to unregister if it has a callback in the pending queue. Signed-off-by: Corey Minyard <[email protected]>
1 parent ff2d2bc commit f2a3116

File tree

1 file changed

+12
-22
lines changed

1 file changed

+12
-22
lines changed

drivers/char/ipmi/ipmi_msghandler.c

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3893,17 +3893,12 @@ static int handle_ipmb_get_msg_cmd(struct ipmi_smi *intf,
38933893
dev_dbg(intf->si_dev, "Invalid command: %*ph\n",
38943894
msg->data_size, msg->data);
38953895

3896-
mutex_lock(&ipmi_interfaces_mutex);
3897-
if (!intf->in_shutdown) {
3898-
smi_send(intf, intf->handlers, msg, 0);
3899-
/*
3900-
* We used the message, so return the value
3901-
* that causes it to not be freed or
3902-
* queued.
3903-
*/
3904-
rv = -1;
3905-
}
3906-
mutex_unlock(&ipmi_interfaces_mutex);
3896+
smi_send(intf, intf->handlers, msg, 0);
3897+
/*
3898+
* We used the message, so return the value that
3899+
* causes it to not be freed or queued.
3900+
*/
3901+
rv = -1;
39073902
} else {
39083903
recv_msg = ipmi_alloc_recv_msg();
39093904
if (!recv_msg) {
@@ -3984,17 +3979,12 @@ static int handle_ipmb_direct_rcv_cmd(struct ipmi_smi *intf,
39843979
msg->data[4] = IPMI_INVALID_CMD_COMPLETION_CODE;
39853980
msg->data_size = 5;
39863981

3987-
mutex_lock(&ipmi_interfaces_mutex);
3988-
if (!intf->in_shutdown) {
3989-
smi_send(intf, intf->handlers, msg, 0);
3990-
/*
3991-
* We used the message, so return the value
3992-
* that causes it to not be freed or
3993-
* queued.
3994-
*/
3995-
rv = -1;
3996-
}
3997-
mutex_unlock(&ipmi_interfaces_mutex);
3982+
smi_send(intf, intf->handlers, msg, 0);
3983+
/*
3984+
* We used the message, so return the value that
3985+
* causes it to not be freed or queued.
3986+
*/
3987+
rv = -1;
39983988
} else {
39993989
recv_msg = ipmi_alloc_recv_msg();
40003990
if (!recv_msg) {

0 commit comments

Comments
 (0)