summaryrefslogtreecommitdiff
path: root/drivers/char/ipmi/ipmi_msghandler.c
diff options
context:
space:
mode:
authorCorey Minyard <cminyard@mvista.com>2021-09-30 16:50:06 +0300
committerCorey Minyard <cminyard@mvista.com>2021-10-05 14:54:16 +0300
commitfac56b7ddec949a957b5d8a9c37a6db3881e4cba (patch)
tree3754100cd15ecfcaa4e816a3b3fa811569b7c09a /drivers/char/ipmi/ipmi_msghandler.c
parent17a4262799fa7449e8fe06fe6d930ab7f5f32528 (diff)
downloadlinux-fac56b7ddec949a957b5d8a9c37a6db3881e4cba.tar.xz
ipmi: Check error code before processing BMC response
In case an error did occur, print out useful information. Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char/ipmi/ipmi_msghandler.c')
-rw-r--r--drivers/char/ipmi/ipmi_msghandler.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index a08f53f208bf..13988f88f1b0 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -2369,6 +2369,13 @@ static void bmc_device_id_handler(struct ipmi_smi *intf,
return;
}
+ if (msg->msg.data[0]) {
+ dev_warn(intf->si_dev, "device id fetch failed: 0x%2.2x\n",
+ msg->msg.data[0]);
+ intf->bmc->dyn_id_set = 0;
+ goto out;
+ }
+
rv = ipmi_demangle_device_id(msg->msg.netfn, msg->msg.cmd,
msg->msg.data, msg->msg.data_len, &intf->bmc->fetch_id);
if (rv) {
@@ -2384,7 +2391,7 @@ static void bmc_device_id_handler(struct ipmi_smi *intf,
smp_wmb();
intf->bmc->dyn_id_set = 1;
}
-
+out:
wake_up(&intf->waitq);
}