Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: usbtest: fix a type promotion bug

The "len" here is sometimes negative error codes from
usb_get_descriptor(), so we don't want to type promote them to unsigned
long.

This bug pre-dates the invention of git.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/506f7935-2cba-41d9-ab5d-ddb6ad6320bd@moroto.mountain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dan Carpenter and committed by
Greg Kroah-Hartman
0f5aa1b0 b8aaf639

+1 -1
+1 -1
drivers/usb/misc/usbtest.c
··· 705 705 { 706 706 struct usb_config_descriptor *config; 707 707 708 - if (len < sizeof(*config)) 708 + if (len < (int)sizeof(*config)) 709 709 return 0; 710 710 config = (struct usb_config_descriptor *) tdev->buf; 711 711