Skip to content
Snippets Groups Projects
Commit 217d1697 authored by Rajesh Bhagat's avatar Rajesh Bhagat Committed by Marek Vasut
Browse files

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: default avatarRajesh Bhagat <rajesh.bhagat@nxp.com>
parent b66a5c03
No related branches found
No related tags found
No related merge requests found
...@@ -65,7 +65,8 @@ int ehci_hcd_init(int index, enum usb_init_type init, ...@@ -65,7 +65,8 @@ int ehci_hcd_init(int index, enum usb_init_type init,
mdelay(5); mdelay(5);
} }
memset(current_usb_controller, '\0', 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) { switch (index) {
case 0: case 0:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment