Re: [PATCH 2/3] gpio: mockup: dynamically allocate memory for chip name

From: Linus Walleij
Date: Wed Dec 28 2016 - 08:13:26 EST


On Tue, Dec 20, 2016 at 12:28 PM, Bartosz Golaszewski
<bgolaszewski@xxxxxxxxxxxx> wrote:

> Currently the chip name buffer is allocated on the stack and the
> address of the buffer is passed to the gpio framework. It's invalid
> after probe() returns, so the sysfs label attribute displays garbage.
>
> Use devm_kasprintf() for each string instead.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@xxxxxxxxxxxx>

Patch applied.

Yours,
Linus Walleij