public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] usb: fsl: Fix NULL terminating issue for usb controller name string
@ 2016-06-18  5:17 Rajesh Bhagat
  2016-06-18 18:11 ` Marek Vasut
  0 siblings, 1 reply; 2+ messages in thread
From: Rajesh Bhagat @ 2016-06-18  5:17 UTC (permalink / raw)
  To: u-boot

Fixes NULL terminating issue for usb controller name string by using
sizeof operator.

Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
---
 drivers/usb/host/ehci-fsl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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:
-- 
2.6.2.198.g614a2ac

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH v2] usb: fsl: Fix NULL terminating issue for usb controller name string
  2016-06-18  5:17 [U-Boot] [PATCH v2] usb: fsl: Fix NULL terminating issue for usb controller name string Rajesh Bhagat
@ 2016-06-18 18:11 ` Marek Vasut
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Vasut @ 2016-06-18 18:11 UTC (permalink / raw)
  To: u-boot

On 06/18/2016 07:17 AM, Rajesh Bhagat wrote:
> Fixes NULL terminating issue for usb controller name string by using
> sizeof operator.
> 
> Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>

Applied, thanks.

> ---
>  drivers/usb/host/ehci-fsl.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Changelog for V2 is missing btw.

> 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:
> 


-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-18 18:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-18  5:17 [U-Boot] [PATCH v2] usb: fsl: Fix NULL terminating issue for usb controller name string Rajesh Bhagat
2016-06-18 18:11 ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox