[PATCH 7/9] gpiolib-sysfs: Add gpio name parsing for sysfs export
Johan Hovold
johan at kernel.org
Fri Jul 31 01:44:56 PDT 2015
On Wed, Jul 29, 2015 at 08:57:36AM +0200, Markus Pargmann wrote:
> On Tue, Jul 28, 2015 at 11:50:04AM +0200, Johan Hovold wrote:
> > On Fri, Jul 17, 2015 at 11:32:48AM +0200, Markus Pargmann wrote:
> > > + char *gpio_name = kstrdup(buf, GFP_KERNEL);
> >
> > Must check for allocation failures, but why use kstrdup at all?
>
> Yes have to check that.
> strim() may modify the buf variable which is constant.
>
> > > +
> > > + desc = gpio_name_to_desc(strim(gpio_name));
Ah, I missed that strim.
Johan
More information about the linux-arm-kernel
mailing list