From: Rajesh Bhagat Date: Sat, 18 Jun 2016 05:17:10 +0000 (+0530) Subject: usb: fsl: Fix NULL terminating issue for usb controller name string X-Git-Tag: v2016.07~17^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=217d16973db6239c88ca77c7ffe3e4abdaf58d57;p=u-boot 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 --- diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index a43d37de0b..fa916ed77f 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: