USB: legousbtower: fix a signedness bug in tower_probe()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 11 Oct 2019 14:11:15 +0000 (17:11 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Nov 2019 12:08:49 +0000 (13:08 +0100)
commit3d8afacef1ccd12ceb7cfec69587e18f67de24b5
tree2bc90f87f57fe5719254e5bb5d478f364fd68123
parent724337746b1a1a5519e10b536e8d32f32312f6aa
USB: legousbtower: fix a signedness bug in tower_probe()

[ Upstream commit fd47a417e75e2506eb3672ae569b1c87e3774155 ]

The problem is that sizeof() is unsigned long so negative error codes
are type promoted to high positive values and the condition becomes
false.

Fixes: 1d427be4a39d ("USB: legousbtower: fix slab info leak at probe")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20191011141115.GA4521@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/misc/legousbtower.c