]> git.baikalelectronics.ru Git - kernel.git/commit
ipmi: msghandler: Fix a signedness bug
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 18 Sep 2020 14:27:56 +0000 (17:27 +0300)
committerCorey Minyard <cminyard@mvista.com>
Fri, 18 Sep 2020 21:34:52 +0000 (16:34 -0500)
commit035db4719297809c3a645bf690aec5933d5da1c1
treebd375d517b90c44e6d43f5430be3f9f601011f80
parent692c575c02e9b6cc733d64747f830647e5dc7f68
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: b4f4d751bbe0 ("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>
drivers/char/ipmi/ipmi_msghandler.c
drivers/char/ipmi/ipmi_si_intf.c