public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] auxdisplay: hd44780: Fix an API misuse in hd44780.c
@ 2025-02-24 10:15 Haoxiang Li
  2025-02-24 10:36 ` Andy Shevchenko
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Haoxiang Li @ 2025-02-24 10:15 UTC (permalink / raw)
  To: andy, geert, haoxiang_li2024, u.kleine-koenig, erick.archer,
	ojeda, w, poeschel
  Cc: linux-kernel, stable

Variable allocated by charlcd_alloc() should be released
by charlcd_free(). The following patch changed kfree() to
charlcd_free() to fix an API misuse.

Fixes: 718e05ed92ec ("auxdisplay: Introduce hd44780_common.[ch]")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
---
Changes in v2:
- Merge the two patches into one.
- Modify the patch description.
Sorry Geert, I didn't see your reply until after I sent the
second patch. I've merged the two patches into one, hoping
to make your work a bit easier! Thanks a lot!
---
 drivers/auxdisplay/hd44780.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/auxdisplay/hd44780.c b/drivers/auxdisplay/hd44780.c
index 0526f0d90a79..9d0ae9c02e9b 100644
--- a/drivers/auxdisplay/hd44780.c
+++ b/drivers/auxdisplay/hd44780.c
@@ -313,7 +313,7 @@ static int hd44780_probe(struct platform_device *pdev)
 fail3:
 	kfree(hd);
 fail2:
-	kfree(lcd);
+	charlcd_free(lcd);
 fail1:
 	kfree(hdc);
 	return ret;
@@ -328,7 +328,7 @@ static void hd44780_remove(struct platform_device *pdev)
 	kfree(hdc->hd44780);
 	kfree(lcd->drvdata);
 
-	kfree(lcd);
+	charlcd_free(lcd);
 }
 
 static const struct of_device_id hd44780_of_match[] = {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] auxdisplay: hd44780: Fix an API misuse in hd44780.c
  2025-02-24 10:15 [PATCH v2] auxdisplay: hd44780: Fix an API misuse in hd44780.c Haoxiang Li
@ 2025-02-24 10:36 ` Andy Shevchenko
  2025-02-24 10:39 ` Andy Shevchenko
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2025-02-24 10:36 UTC (permalink / raw)
  To: Haoxiang Li
  Cc: geert, u.kleine-koenig, erick.archer, ojeda, w, poeschel,
	linux-kernel, stable

On Mon, Feb 24, 2025 at 06:15:27PM +0800, Haoxiang Li wrote:
> Variable allocated by charlcd_alloc() should be released
> by charlcd_free(). The following patch changed kfree() to
> charlcd_free() to fix an API misuse.

...

> - Merge the two patches into one.

Thanks!

> - Modify the patch description.
> Sorry Geert, I didn't see your reply until after I sent the
> second patch. I've merged the two patches into one, hoping
> to make your work a bit easier! Thanks a lot!

In any case it's better if Geert acks/reviews this one as from code p.o.v.
it's a 50% change :-)

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] auxdisplay: hd44780: Fix an API misuse in hd44780.c
  2025-02-24 10:15 [PATCH v2] auxdisplay: hd44780: Fix an API misuse in hd44780.c Haoxiang Li
  2025-02-24 10:36 ` Andy Shevchenko
@ 2025-02-24 10:39 ` Andy Shevchenko
  2025-02-24 12:30 ` Geert Uytterhoeven
  2025-02-24 12:35 ` Andy Shevchenko
  3 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2025-02-24 10:39 UTC (permalink / raw)
  To: Haoxiang Li
  Cc: geert, u.kleine-koenig, erick.archer, ojeda, w, poeschel,
	linux-kernel, stable

On Mon, Feb 24, 2025 at 06:15:27PM +0800, Haoxiang Li wrote:
> Variable allocated by charlcd_alloc() should be released
> by charlcd_free(). The following patch changed kfree() to
> charlcd_free() to fix an API misuse.

> ---
> Changes in v2:
> - Merge the two patches into one.
> - Modify the patch description.
> Sorry Geert, I didn't see your reply until after I sent the
> second patch. I've merged the two patches into one, hoping
> to make your work a bit easier! Thanks a lot!

Btw, have you seen this one?

https://lore.kernel.org/r/20221128084421.8626-1-niejianglei2021@163.com

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] auxdisplay: hd44780: Fix an API misuse in hd44780.c
  2025-02-24 10:15 [PATCH v2] auxdisplay: hd44780: Fix an API misuse in hd44780.c Haoxiang Li
  2025-02-24 10:36 ` Andy Shevchenko
  2025-02-24 10:39 ` Andy Shevchenko
@ 2025-02-24 12:30 ` Geert Uytterhoeven
  2025-02-24 12:36   ` Andy Shevchenko
  2025-02-24 12:35 ` Andy Shevchenko
  3 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2025-02-24 12:30 UTC (permalink / raw)
  To: Haoxiang Li
  Cc: andy, u.kleine-koenig, erick.archer, ojeda, w, poeschel,
	linux-kernel, stable

On Mon, 24 Feb 2025 at 11:16, Haoxiang Li <haoxiang_li2024@163.com> wrote:
> Variable allocated by charlcd_alloc() should be released
> by charlcd_free(). The following patch changed kfree() to
> charlcd_free() to fix an API misuse.
>
> Fixes: 718e05ed92ec ("auxdisplay: Introduce hd44780_common.[ch]")
> Cc: stable@vger.kernel.org
> Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
> ---
> Changes in v2:
> - Merge the two patches into one.
> - Modify the patch description.

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] auxdisplay: hd44780: Fix an API misuse in hd44780.c
  2025-02-24 10:15 [PATCH v2] auxdisplay: hd44780: Fix an API misuse in hd44780.c Haoxiang Li
                   ` (2 preceding siblings ...)
  2025-02-24 12:30 ` Geert Uytterhoeven
@ 2025-02-24 12:35 ` Andy Shevchenko
  2025-02-24 13:33   ` Geert Uytterhoeven
  3 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2025-02-24 12:35 UTC (permalink / raw)
  To: Haoxiang Li
  Cc: geert, u.kleine-koenig, erick.archer, ojeda, w, poeschel,
	linux-kernel, stable

On Mon, Feb 24, 2025 at 06:15:27PM +0800, Haoxiang Li wrote:
> Variable allocated by charlcd_alloc() should be released
> by charlcd_free(). The following patch changed kfree() to
> charlcd_free() to fix an API misuse.

> Fixes: 718e05ed92ec ("auxdisplay: Introduce hd44780_common.[ch]")
> Cc: stable@vger.kernel.org

Okay, looking closer to the current state of affairs, the change
does not fix anything actually. OTOH it's correct semantically and
allows to do any further development in charlcd_alloc(), if any.

That said, if Geert is okay with it, I would like to apply but without
Fixes/Cc: stable@ tags.

P.S.
The very similar needs to be applied to panel.c, but I already have
a patch for that locally, thanks to this thread.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] auxdisplay: hd44780: Fix an API misuse in hd44780.c
  2025-02-24 12:30 ` Geert Uytterhoeven
@ 2025-02-24 12:36   ` Andy Shevchenko
  0 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2025-02-24 12:36 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Haoxiang Li, u.kleine-koenig, erick.archer, ojeda, w, poeschel,
	linux-kernel, stable

On Mon, Feb 24, 2025 at 01:30:47PM +0100, Geert Uytterhoeven wrote:
> On Mon, 24 Feb 2025 at 11:16, Haoxiang Li <haoxiang_li2024@163.com> wrote:
> > Variable allocated by charlcd_alloc() should be released
> > by charlcd_free(). The following patch changed kfree() to
> > charlcd_free() to fix an API misuse.
> >
> > Fixes: 718e05ed92ec ("auxdisplay: Introduce hd44780_common.[ch]")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
> > ---
> > Changes in v2:
> > - Merge the two patches into one.
> > - Modify the patch description.
> 
> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Pushed to my review and testing queue, thanks!

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] auxdisplay: hd44780: Fix an API misuse in hd44780.c
  2025-02-24 12:35 ` Andy Shevchenko
@ 2025-02-24 13:33   ` Geert Uytterhoeven
  2025-02-24 13:38     ` Andy Shevchenko
  0 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2025-02-24 13:33 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Haoxiang Li, u.kleine-koenig, erick.archer, ojeda, w, poeschel,
	linux-kernel, stable

Hi Andy,

On Mon, 24 Feb 2025 at 13:35, Andy Shevchenko <andy@kernel.org> wrote:
> On Mon, Feb 24, 2025 at 06:15:27PM +0800, Haoxiang Li wrote:
> > Variable allocated by charlcd_alloc() should be released
> > by charlcd_free(). The following patch changed kfree() to
> > charlcd_free() to fix an API misuse.
>
> > Fixes: 718e05ed92ec ("auxdisplay: Introduce hd44780_common.[ch]")
> > Cc: stable@vger.kernel.org
>
> Okay, looking closer to the current state of affairs, the change
> does not fix anything actually. OTOH it's correct semantically and
> allows to do any further development in charlcd_alloc(), if any.
>
> That said, if Geert is okay with it, I would like to apply but without
> Fixes/Cc: stable@ tags.

I had mixed feelings about the Fixes-tag, too.
Semantically, it's indeed a fix.  If any further cleanups are ever done
and backported, but this patch would be  missed, it would introduce a bug.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] auxdisplay: hd44780: Fix an API misuse in hd44780.c
  2025-02-24 13:33   ` Geert Uytterhoeven
@ 2025-02-24 13:38     ` Andy Shevchenko
  0 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2025-02-24 13:38 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Haoxiang Li, u.kleine-koenig, erick.archer, ojeda, w, poeschel,
	linux-kernel, stable

On Mon, Feb 24, 2025 at 02:33:49PM +0100, Geert Uytterhoeven wrote:
> On Mon, 24 Feb 2025 at 13:35, Andy Shevchenko <andy@kernel.org> wrote:
> > On Mon, Feb 24, 2025 at 06:15:27PM +0800, Haoxiang Li wrote:
> > > Variable allocated by charlcd_alloc() should be released
> > > by charlcd_free(). The following patch changed kfree() to
> > > charlcd_free() to fix an API misuse.
> >
> > > Fixes: 718e05ed92ec ("auxdisplay: Introduce hd44780_common.[ch]")
> > > Cc: stable@vger.kernel.org
> >
> > Okay, looking closer to the current state of affairs, the change
> > does not fix anything actually. OTOH it's correct semantically and
> > allows to do any further development in charlcd_alloc(), if any.
> >
> > That said, if Geert is okay with it, I would like to apply but without
> > Fixes/Cc: stable@ tags.
> 
> I had mixed feelings about the Fixes-tag, too.
> Semantically, it's indeed a fix.  If any further cleanups are ever done
> and backported, but this patch would be  missed, it would introduce a bug.

Okay, I return it.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-02-24 13:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-24 10:15 [PATCH v2] auxdisplay: hd44780: Fix an API misuse in hd44780.c Haoxiang Li
2025-02-24 10:36 ` Andy Shevchenko
2025-02-24 10:39 ` Andy Shevchenko
2025-02-24 12:30 ` Geert Uytterhoeven
2025-02-24 12:36   ` Andy Shevchenko
2025-02-24 12:35 ` Andy Shevchenko
2025-02-24 13:33   ` Geert Uytterhoeven
2025-02-24 13:38     ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox