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:
b66a5c0
)
usb: fsl: Fix NULL terminating issue for usb controller name string
author
Rajesh Bhagat
<rajesh.bhagat@nxp.com>
Sat, 18 Jun 2016 05:17:10 +0000
(10:47 +0530)
committer
Marek Vasut
<marex@denx.de>
Fri, 24 Jun 2016 22:57:09 +0000
(
00:57
+0200)
Fixes NULL terminating issue for usb controller name string by using
sizeof operator.
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
drivers/usb/host/ehci-fsl.c
patch
|
blob
|
history
diff --git
a/drivers/usb/host/ehci-fsl.c
b/drivers/usb/host/ehci-fsl.c
index a43d37de0bc9ee507b5de5bcb2cc0bd882ca5d55..fa916ed77f99882d168d218e41d61950b8a9ae51 100644
(file)
--- a/
drivers/usb/host/ehci-fsl.c
+++ b/
drivers/usb/host/ehci-fsl.c
@@
-65,7
+65,8
@@
int ehci_hcd_init(int index, enum usb_init_type init,
mdelay(5);
}
memset(current_usb_controller, '\0', 5);
- snprintf(current_usb_controller, 4, "usb%d", index+1);
+ snprintf(current_usb_controller, sizeof(current_usb_controller),
+ "usb%d", index+1);
switch (index) {
case 0: