From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752378AbcJJKxy (ORCPT ); Mon, 10 Oct 2016 06:53:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:60660 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752245AbcJJKxw (ORCPT ); Mon, 10 Oct 2016 06:53:52 -0400 Subject: Re: [PATCH] usb/gadget: use kasprintf() instead of open coding it To: Felipe Balbi , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org References: <1476094677-15101-1-git-send-email-jgross@suse.com> <87vax0wldw.fsf@linux.intel.com> Cc: gregkh@linuxfoundation.org From: Juergen Gross Message-ID: <6ca032f4-6279-6edb-0ca7-6fa5722343dd@suse.com> Date: Mon, 10 Oct 2016 12:34:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <87vax0wldw.fsf@linux.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/10/16 12:26, Felipe Balbi wrote: > > Hi, > > Juergen Gross writes: > >> Signed-off-by: Juergen Gross > > I can't apply anything without a commit log. Sorry. I always thought a subject line telling the complete story would be enough. I'll resend with the subject duplicated to the body. Juergen > >> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c >> index 32176f7..455efec 100644 >> --- a/drivers/usb/gadget/composite.c >> +++ b/drivers/usb/gadget/composite.c >> @@ -2382,18 +2382,8 @@ EXPORT_SYMBOL_GPL(usb_composite_setup_continue); >> >> static char *composite_default_mfr(struct usb_gadget *gadget) >> { >> - char *mfr; >> - int len; >> - >> - len = snprintf(NULL, 0, "%s %s with %s", init_utsname()->sysname, >> - init_utsname()->release, gadget->name); >> - len++; >> - mfr = kmalloc(len, GFP_KERNEL); >> - if (!mfr) >> - return NULL; >> - snprintf(mfr, len, "%s %s with %s", init_utsname()->sysname, >> - init_utsname()->release, gadget->name); >> - return mfr; >> + return kasprintf(GFP_KERNEL, "%s %s with %s", init_utsname()->sysname, >> + init_utsname()->release, gadget->name); >> } >> >> void usb_composite_overwrite_options(struct usb_composite_dev *cdev, >> -- >> 2.6.6 >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-usb" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >