Re: [PATCH v1.1] gpiolib: append SFI helpers for GPIO API

From: Joe Perches
Date: Mon Jun 03 2013 - 08:26:36 EST


On Mon, 2013-06-03 at 11:16 +0300, Andy Shevchenko wrote:
> On Sun, 2013-06-02 at 19:06 -0700, Joe Perches wrote:
> > On Mon, 2013-06-03 at 11:59 +1000, Ryan Mallon wrote:
> > > On 31/05/13 19:27, Andy Shevchenko wrote:
> > > > + sfi_gpio_table = kmalloc(num * sizeof(*pentry), GFP_KERNEL);
> > > Use kcalloc when you have a size and a count.
> > kmalloc_array unless you want zero'ed memory
> One proposed to use kmemdup to clean up a bit. What do you think?

Seems correct to use kmemdup but what validates num?

It seems like a possible error path exists there regardless
of whether kmemdup is used or not.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/