summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2018-04-13 05:33:39 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2018-04-13 05:33:39 +0000
commitf4e37f0580b950791e63730166f2946a114c83c6 (patch)
tree20d27fc668d541a8ef5ba8fce3b4a3d046bf58d3
parenta5fb210d99f69bb7edec15e9adacbe9f14efaaf6 (diff)
Don't panic if ipmi_sendcmd() fails
diff from fukaumi at soum.co.jp. ok deraadt mpi
-rw-r--r--sys/dev/ipmi.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/dev/ipmi.c b/sys/dev/ipmi.c
index 4e3be12e6e2..c2e3199f16c 100644
--- a/sys/dev/ipmi.c
+++ b/sys/dev/ipmi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipmi.c,v 1.100 2018/01/01 16:16:23 bluhm Exp $ */
+/* $OpenBSD: ipmi.c,v 1.101 2018/04/13 05:33:38 yasuoka Exp $ */
/*
* Copyright (c) 2015 Masao Uebayashi
@@ -1039,10 +1039,10 @@ ipmi_cmd_poll(struct ipmi_cmd *c)
{
mtx_enter(&c->c_sc->sc_cmd_mtx);
- if (ipmi_sendcmd(c)) {
- panic("%s: sendcmd fails", DEVNAME(c->c_sc));
- }
- c->c_ccode = ipmi_recvcmd(c);
+ if ((c->c_ccode = ipmi_sendcmd(c)))
+ printf("%s: sendcmd fails\n", DEVNAME(c->c_sc));
+ else
+ c->c_ccode = ipmi_recvcmd(c);
mtx_leave(&c->c_sc->sc_cmd_mtx);
}
@@ -1819,8 +1819,6 @@ ipmiioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *proc)
c->c_txlen = req->msg.data_len;
c->c_rxlen = 0;
ipmi_cmd(c);
-
- KASSERT(c->c_ccode != -1);
break;
case IPMICTL_RECEIVE_MSG_TRUNC:
case IPMICTL_RECEIVE_MSG: