mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-14 21:10:27 +01:00
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>
This commit is contained in:
parent
b66a5c03a0
commit
217d16973d
1 changed files with 2 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue