summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRajesh Bhagat <rajesh.bhagat@nxp.com>2016-06-18 10:47:10 +0530
committerMarek Vasut <marex@denx.de>2016-06-25 00:57:09 +0200
commit217d16973db6239c88ca77c7ffe3e4abdaf58d57 (patch)
treea39adaa64b190ff659edc9545f72e38efa321425 /drivers
parentb66a5c03a0870db3045be2967b85684b1887ca18 (diff)
downloadu-boot-imx-217d16973db6239c88ca77c7ffe3e4abdaf58d57.zip
u-boot-imx-217d16973db6239c88ca77c7ffe3e4abdaf58d57.tar.gz
u-boot-imx-217d16973db6239c88ca77c7ffe3e4abdaf58d57.tar.bz2
usb: fsl: Fix NULL terminating issue for usb controller name string
Fixes NULL terminating issue for usb controller name string by using sizeof operator. Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/ehci-fsl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index a43d37d..fa916ed 100644
--- 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: