From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sat, 18 Jun 2016 20:11:38 +0200 Subject: [U-Boot] [PATCH v2] usb: fsl: Fix NULL terminating issue for usb controller name string In-Reply-To: <1466227030-32271-1-git-send-email-rajesh.bhagat@nxp.com> References: <1466227030-32271-1-git-send-email-rajesh.bhagat@nxp.com> Message-ID: <57658EDA.9050504@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 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