diff options
author | Corey Minyard <cminyard@mvista.com> | 2019-08-16 16:13:42 -0500 |
---|---|---|
committer | Corey Minyard <cminyard@mvista.com> | 2019-08-16 16:18:18 -0500 |
commit | 2033f6858970b98c18bed4d5ae68f43d17400abc (patch) | |
tree | 2542b278acb0b9d3163af72fd510a2b131ad56fb /drivers/char | |
parent | 340ff31ab00bca5c15915e70ad9ada3030c98cf8 (diff) | |
download | linux-2033f6858970b98c18bed4d5ae68f43d17400abc.tar.bz2 |
ipmi: Free receive messages when in an oops
If the driver handles a response in an oops, it was just ignoring
the message. However, the IPMI watchdog timer was counting on the
free happening to know when panic-time messages were complete. So
free it in all cases.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 6707659cffd6..3548aceed4a9 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c @@ -904,12 +904,14 @@ static int deliver_response(struct ipmi_smi *intf, struct ipmi_recv_msg *msg) rv = -EINVAL; } ipmi_free_recv_msg(msg); - } else if (!oops_in_progress) { + } else if (oops_in_progress) { /* * If we are running in the panic context, calling the * receive handler doesn't much meaning and has a deadlock * risk. At this moment, simply skip it in that case. */ + ipmi_free_recv_msg(msg); + } else { int index; struct ipmi_user *user = acquire_ipmi_user(msg->user, &index); @@ -2220,7 +2222,8 @@ static int i_ipmi_request(struct ipmi_user *user, else { smi_msg = ipmi_alloc_smi_msg(); if (smi_msg == NULL) { - ipmi_free_recv_msg(recv_msg); + if (!supplied_recv) + ipmi_free_recv_msg(recv_msg); rv = -ENOMEM; goto out; } |