From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] usb: fsl: Fix NULL terminating issue for usb controller name string
Date: Sat, 18 Jun 2016 20:11:38 +0200 [thread overview]
Message-ID: <57658EDA.9050504@denx.de> (raw)
In-Reply-To: <1466227030-32271-1-git-send-email-rajesh.bhagat@nxp.com>
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
prev parent reply other threads:[~2016-06-18 18:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57658EDA.9050504@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.