projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b8aaf63
)
usb: usbtest: fix a type promotion bug
author
Dan Carpenter
<dan.carpenter@linaro.org>
Thu, 5 Oct 2023 14:01:05 +0000
(17:01 +0300)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Sun, 8 Oct 2023 05:50:36 +0000
(07:50 +0200)
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>
drivers/usb/misc/usbtest.c
patch
|
blob
|
history
diff --git
a/drivers/usb/misc/usbtest.c
b/drivers/usb/misc/usbtest.c
index ac0d75ac2d2fae19a9771b86806375bdc0f72094..caf65f8294db22c74f080d2c2ccd6fe4f994f9bb 100644
(file)
--- a/
drivers/usb/misc/usbtest.c
+++ b/
drivers/usb/misc/usbtest.c
@@
-705,7
+705,7
@@
static int is_good_config(struct usbtest_dev *tdev, int len)
{
struct usb_config_descriptor *config;
- if (len < sizeof(*config))
+ if (len <
(int)
sizeof(*config))
return 0;
config = (struct usb_config_descriptor *) tdev->buf;