[PATCH] GPIO: gpio-generic: Remove kfree() from bgpio_remove call

Linus Walleij linus.walleij at linaro.org
Thu Apr 11 13:35:21 EDT 2013


On Thu, Apr 11, 2013 at 7:23 PM, Alexander Shiyan <shc_work at mail.ru> wrote:

> Memory for basic-mmio-gpio driver is allocated by resource managed
> function, so using kfree() call in bgpio_remove is wrong.
> This patch eliminates this kfree() call.
>
> Signed-off-by: Alexander Shiyan <shc_work at mail.ru>

So I think the patch is correct but the commit message is wrong.

It is not certain at all that bgpio is resource managed, but the point
of the patch should be that it's up to the driver using it to allocate
and free its struct bgpio_chip, after calling this function.

A quick glance on the consumers gives at hand that this is the case
for all consumers, so I took the liberty to update the commit
message and apply it...

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list