summaryrefslogtreecommitdiff
path: root/drivers/char/ipmi/ipmi_si_intf.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-09-18 17:27:56 +0300
committerCorey Minyard <cminyard@mvista.com>2020-09-19 00:34:52 +0300
commitc011410d9145695c460567fa5ba1ade6a7b16f06 (patch)
treebd375d517b90c44e6d43f5430be3f9f601011f80 /drivers/char/ipmi/ipmi_si_intf.c
parent42d8a346c5c06689f4f25aecfa287a5aca501a55 (diff)
downloadlinux-c011410d9145695c460567fa5ba1ade6a7b16f06.tar.xz
ipmi: msghandler: Fix a signedness bug
The type for the completion codes should be unsigned char instead of char. If it is declared as a normal char then the conditions in __get_device_id() are impossible because the IPMI_DEVICE_IN_FW_UPDATE_ERR error codes are higher than 127. drivers/char/ipmi/ipmi_msghandler.c:2449 __get_device_id() warn: impossible condition '(bmc->cc == 209) => ((-128)-127 == 209)' Fixes: f8910ffa81b0 ("ipmi:msghandler: retry to get device id on an error") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Message-Id: <20200918142756.GB909725@mwanda> Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char/ipmi/ipmi_si_intf.c')
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 164f85007080..0b3dbc7e39fd 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -1344,7 +1344,7 @@ retry:
resp + 2, resp_len - 2, &smi_info->device_id);
if (rv) {
/* record completion code */
- char cc = *(resp + 2);
+ unsigned char cc = *(resp + 2);
if ((cc == IPMI_DEVICE_IN_FW_UPDATE_ERR
|| cc == IPMI_DEVICE_IN_INIT_ERR