usbip: stub_rx: fix static checker warning on unnecessary checks
authorShuah Khan <shuahkh@osg.samsung.com>
Fri, 15 Dec 2017 17:05:15 +0000 (10:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Dec 2017 10:40:55 +0000 (11:40 +0100)
commit10c90120930628e8b959bf58d4a0aaef3ae5d945
tree67de4d5442bd061f65415df6eb886316b06b0b18
parent90120d15f4c397272aaf41077960a157fc4212bf
usbip: stub_rx: fix static checker warning on unnecessary checks

Fix the following static checker warnings:

The patch c6688ef9f297: "usbip: fix stub_rx: harden CMD_SUBMIT path
to handle malicious input" from Dec 7, 2017, leads to the following
static checker warning:

    drivers/usb/usbip/stub_rx.c:346 get_pipe()
    warn: impossible condition
'(pdu->u.cmd_submit.transfer_buffer_length > ((~0 >> 1))) =>
(s32min-s32max > s32max)'
    drivers/usb/usbip/stub_rx.c:486 stub_recv_cmd_submit()
    warn: always true condition
'(pdu->u.cmd_submit.transfer_buffer_length <= ((~0 >> 1))) =>
(s32min-s32max <= s32max)'

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/usbip/stub_rx.c