[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190312144052.GC9224@smile.fi.intel.com>
Date: Tue, 12 Mar 2019 16:40:52 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@...il.com>,
Willy Tarreau <willy@...roxy.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 1/4] auxdisplay: hd44780: Fix memory leak on ->remove()
On Tue, Mar 12, 2019 at 02:47:01PM +0100, Geert Uytterhoeven wrote:
> On Tue, Mar 12, 2019 at 2:18 PM Andy Shevchenko
> <andriy.shevchenko@...ux.intel.com> wrote:
> > We have to free on ->remove() the allocated resources on ->probe().
> >
> > Fixes: d47d88361fee ("auxdisplay: Add HD44780 Character LCD support")
> > Cc: Geert Uytterhoeven <geert@...ux-m68k.org>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
>
> Thanks, nice catch!
>
> (wearing a newer (and hopefully wiser ;-) hat than when I wrote the code)
>
> While this is correct for the current implementation of struct charlcd_priv,
> this may be a bit fragile.
This patch will be the same in the next version due to possibility to easy
backport.
> What about adding a charlcd_free() wrapper, which can do kfree(to_priv(lcd)),
> and be used in the probe failure path, too?
This has been partially done in the rest of the series, but I got your advise
and will change to use to_priv() in v2. Thanks!
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists