Skip to content

Commit fac56b7

Browse files
committed
ipmi: Check error code before processing BMC response
In case an error did occur, print out useful information. Signed-off-by: Corey Minyard <[email protected]>
1 parent 17a4262 commit fac56b7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/char/ipmi/ipmi_msghandler.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2369,6 +2369,13 @@ static void bmc_device_id_handler(struct ipmi_smi *intf,
23692369
return;
23702370
}
23712371

2372+
if (msg->msg.data[0]) {
2373+
dev_warn(intf->si_dev, "device id fetch failed: 0x%2.2x\n",
2374+
msg->msg.data[0]);
2375+
intf->bmc->dyn_id_set = 0;
2376+
goto out;
2377+
}
2378+
23722379
rv = ipmi_demangle_device_id(msg->msg.netfn, msg->msg.cmd,
23732380
msg->msg.data, msg->msg.data_len, &intf->bmc->fetch_id);
23742381
if (rv) {
@@ -2384,7 +2391,7 @@ static void bmc_device_id_handler(struct ipmi_smi *intf,
23842391
smp_wmb();
23852392
intf->bmc->dyn_id_set = 1;
23862393
}
2387-
2394+
out:
23882395
wake_up(&intf->waitq);
23892396
}
23902397

0 commit comments

Comments
 (0)