lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180307183019.GA12917@himanshu-Vostro-3559>
Date:   Thu, 8 Mar 2018 00:00:19 +0530
From:   Himanshu Jha <himanshujha199640@...il.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Felipe Balbi <felipe.balbi@...ux.intel.com>,
        Johan Hovold <johan@...nel.org>,
        Kees Cook <keescook@...omium.org>,
        USB <linux-usb@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] usb: isp1760: Use kasprintf

On Wed, Mar 07, 2018 at 08:20:54PM +0200, Andy Shevchenko wrote:
> On Wed, Mar 7, 2018 at 8:08 PM, Himanshu Jha
> <himanshujha199640@...il.com> wrote:
> > Use kasprintf instead of combination of kmalloc and sprintf and
> > therefore avoid unnecessary computation of string length.
> 
> >         devname = dev_name(isp->dev);
> 
> Do you still need this temporary variable?

No.

> > -       udc->irqname = kmalloc(strlen(devname) + 7, GFP_KERNEL);
> > +       udc->irqname = kasprintf(GFP_KERNEL, "%s (udc)", devname);
> 
> Perhaps
> 
> devname -> dev_name(isp->dev)
> 
> ?

Oh, yes!
Thanks for pointing that out.
I will send v2 with the update!

-- 
Thanks
Himanshu Jha

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ