diff options
author | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2020-03-09 04:51:25 +0000 |
---|---|---|
committer | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2020-03-09 04:51:25 +0000 |
commit | 17bc656393fede29483e1d66cb5856dc100132e7 (patch) | |
tree | e60dfbce139248c508387c5dce2c452e22cadbf3 | |
parent | e4c1dc8ea01e6cc3f9960e5a241d530137b7fcdd (diff) |
Return error value when sending "sensor reading" is failed. This fixes
"ipmi0: sendcmd fails" errors when there is a sensor which is
enumurated but reading it is failed.
ok mpi
-rw-r--r-- | sys/dev/ipmi.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/ipmi.c b/sys/dev/ipmi.c index 74ecad0cb30..3419b17d51a 100644 --- a/sys/dev/ipmi.c +++ b/sys/dev/ipmi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipmi.c,v 1.109 2020/02/18 00:06:12 cheloha Exp $ */ +/* $OpenBSD: ipmi.c,v 1.110 2020/03/09 04:51:24 yasuoka Exp $ */ /* * Copyright (c) 2015 Masao Uebayashi @@ -1288,6 +1288,11 @@ read_sensor(struct ipmi_softc *sc, struct ipmi_sensor *psensor) c.c_data = data; ipmi_cmd(&c); + if (c.c_ccode != 0) { + dbg_printf(1, "sensor reading command for %s failed: %.2x\n", + psensor->i_sensor.desc, c.c_ccode); + return (rv); + } dbg_printf(10, "values=%.2x %.2x %.2x %.2x %s\n", data[0],data[1],data[2],data[3], psensor->i_sensor.desc); psensor->i_sensor.flags &= ~SENSOR_FINVALID; |