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 11:18:13 +0000 (12:18 +0100)
commit216521e7f3749c04ffa4d7df55bd2c7138ad9851
treee37cfb47f832ad8c57fe6e8e4d71b34e0ac04ae3
parentc24de624082ae0a5cd7b63c3d8faf3d516a9fad6
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