projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
08c11cb
)
common: usb: fix checking condition
author
Peng Fan
<
[email protected]
>
Tue, 12 Jan 2016 07:57:01 +0000
(15:57 +0800)
committer
Marek Vasut
<
[email protected]
>
Sat, 16 Jan 2016 06:06:55 +0000
(07:06 +0100)
We support max USB_MAXENDPOINTS, so need to use
"epno >= USB_MAXENDPOINTS", but not "epno > USB_MAXENDPOINTS".
If use ">", we may exceeds the array of if_desc->ep_desc.
Signed-off-by: Peng Fan <
[email protected]
>
Cc: Simon Glass <
[email protected]
>
Cc: Hans de Goede <
[email protected]
>
Cc: Marek Vasut <
[email protected]
>
Cc: Paul Kocialkowski <
[email protected]
>
Cc: "Stefan BrĂ¼ns" <
[email protected]
>
Cc: Vincent Palatin <
[email protected]
>
common/usb.c
patch
|
blob
|
history
diff --git
a/common/usb.c
b/common/usb.c
index 9f67cc1e8e8c7af62489b440f85151a9c841965d..c7b8b0ee5a8d7b1f0e00455e04bf6a797a9f7f8c 100644
(file)
--- a/
common/usb.c
+++ b/
common/usb.c
@@
-456,7
+456,7
@@
static int usb_parse_config(struct usb_device *dev,
}
epno = dev->config.if_desc[ifno].no_of_ep;
if_desc = &dev->config.if_desc[ifno];
- if (epno > USB_MAXENDPOINTS) {
+ if (epno >
=
USB_MAXENDPOINTS) {
printf("Interface %d has too many endpoints!\n",
if_desc->desc.bInterfaceNumber);
return -EINVAL;