net: cdc_ncm: Signedness bug in cdc_ncm_set_dgram_size()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 13 Nov 2019 18:28:31 +0000 (21:28 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Nov 2019 22:30:16 +0000 (14:30 -0800)
commita56dcc6b455830776899ce3686735f1172e12243
treedb0f7d98c6120e69e1b9a238655a4c5462429b88
parent3b5a39979dafea9d0cd69c7ae06088f7a84cdafa
net: cdc_ncm: Signedness bug in cdc_ncm_set_dgram_size()

This code is supposed to test for negative error codes and partial
reads, but because sizeof() is size_t (unsigned) type then negative
error codes are type promoted to high positive values and the condition
doesn't work as expected.

Fixes: 332f989a3b00 ("CDC-NCM: handle incomplete transfer of MTU")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/cdc_ncm.c