mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00: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…
Reference in a new issue