Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [PATCH] gpio: sloppy-logic-analyzer: add a comment explaining the buffer init
@ 2026-07-12  9:31 Wolfram Sang
  2026-07-13  8:22 ` Bartosz Golaszewski
  2026-07-13  9:20 ` Geert Uytterhoeven
  0 siblings, 2 replies; 6+ messages in thread
From: Wolfram Sang @ 2026-07-12  9:31 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Abdun Nihaal, Wolfram Sang, Linus Walleij, Bartosz Golaszewski,
	linux-gpio

To avoid more false positive reports of "leaking memory" when
fops_buf_size_set() returns an error.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/gpio/gpio-sloppy-logic-analyzer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpio-sloppy-logic-analyzer.c b/drivers/gpio/gpio-sloppy-logic-analyzer.c
index 2bbd308ca08e..6748ddce3c19 100644
--- a/drivers/gpio/gpio-sloppy-logic-analyzer.c
+++ b/drivers/gpio/gpio-sloppy-logic-analyzer.c
@@ -237,6 +237,7 @@ static int gpio_la_poll_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
+	/* Initially allocate a buffer. It currently is NULL */
 	fops_buf_size_set(priv, GPIO_LA_DEFAULT_BUF_SIZE);
 
 	priv->descs = devm_gpiod_get_array(dev, "probe", GPIOD_IN);
-- 
2.47.3


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

* Re: [PATCH] gpio: sloppy-logic-analyzer: add a comment explaining the buffer init
  2026-07-12  9:31 [PATCH] gpio: sloppy-logic-analyzer: add a comment explaining the buffer init Wolfram Sang
@ 2026-07-13  8:22 ` Bartosz Golaszewski
  2026-07-13  9:20 ` Geert Uytterhoeven
  1 sibling, 0 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2026-07-13  8:22 UTC (permalink / raw)
  To: linux-renesas-soc, Wolfram Sang
  Cc: Bartosz Golaszewski, Abdun Nihaal, Linus Walleij,
	Bartosz Golaszewski, linux-gpio


On Sun, 12 Jul 2026 11:31:48 +0200, Wolfram Sang wrote:
> To avoid more false positive reports of "leaking memory" when
> fops_buf_size_set() returns an error.
> 
> 

Applied, thanks!

[1/1] gpio: sloppy-logic-analyzer: add a comment explaining the buffer init
      https://git.kernel.org/brgl/c/029023cd5c4b75a598e34fec9e48781761c09885

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

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

* Re: [PATCH] gpio: sloppy-logic-analyzer: add a comment explaining the buffer init
  2026-07-12  9:31 [PATCH] gpio: sloppy-logic-analyzer: add a comment explaining the buffer init Wolfram Sang
  2026-07-13  8:22 ` Bartosz Golaszewski
@ 2026-07-13  9:20 ` Geert Uytterhoeven
  2026-07-13  9:46   ` Bartosz Golaszewski
  1 sibling, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2026-07-13  9:20 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-renesas-soc, Abdun Nihaal, Linus Walleij,
	Bartosz Golaszewski, linux-gpio

Hi Wolfram,

Thanks for your patch!

On Sun, 12 Jul 2026 at 11:32, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> To avoid more false positive reports of "leaking memory" when
> fops_buf_size_set() returns an error.

But who is freeing priv->blob.data when fops_buf_size_set() succeeds?

>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

> --- a/drivers/gpio/gpio-sloppy-logic-analyzer.c
> +++ b/drivers/gpio/gpio-sloppy-logic-analyzer.c
> @@ -237,6 +237,7 @@ static int gpio_la_poll_probe(struct platform_device *pdev)
>         if (ret)
>                 return ret;
>
> +       /* Initially allocate a buffer. It currently is NULL */
>         fops_buf_size_set(priv, GPIO_LA_DEFAULT_BUF_SIZE);
>
>         priv->descs = devm_gpiod_get_array(dev, "probe", GPIOD_IN);

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] 6+ messages in thread

* Re: [PATCH] gpio: sloppy-logic-analyzer: add a comment explaining the buffer init
  2026-07-13  9:20 ` Geert Uytterhoeven
@ 2026-07-13  9:46   ` Bartosz Golaszewski
  2026-07-13 10:24     ` Geert Uytterhoeven
  2026-07-13 11:27     ` Wolfram Sang
  0 siblings, 2 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2026-07-13  9:46 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: linux-renesas-soc, Abdun Nihaal, Linus Walleij,
	Bartosz Golaszewski, linux-gpio, Wolfram Sang

On Mon, 13 Jul 2026 11:20:02 +0200, Geert Uytterhoeven
<geert@linux-m68k.org> said:
> Hi Wolfram,
>
> Thanks for your patch!
>
> On Sun, 12 Jul 2026 at 11:32, Wolfram Sang
> <wsa+renesas@sang-engineering.com> wrote:
>> To avoid more false positive reports of "leaking memory" when
>> fops_buf_size_set() returns an error.
>
> But who is freeing priv->blob.data when fops_buf_size_set() succeeds?
>

In case I was too eager picking it up, let me drop it from my tree before I
pushed it out and wait for Wolfram's response.

Bart

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

* Re: [PATCH] gpio: sloppy-logic-analyzer: add a comment explaining the buffer init
  2026-07-13  9:46   ` Bartosz Golaszewski
@ 2026-07-13 10:24     ` Geert Uytterhoeven
  2026-07-13 11:27     ` Wolfram Sang
  1 sibling, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2026-07-13 10:24 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: linux-renesas-soc, Abdun Nihaal, Linus Walleij, linux-gpio,
	Wolfram Sang

Hi Bartosz,

On Mon, 13 Jul 2026 at 11:46, Bartosz Golaszewski <brgl@kernel.org> wrote:
> On Mon, 13 Jul 2026 11:20:02 +0200, Geert Uytterhoeven
> <geert@linux-m68k.org> said:
> > On Sun, 12 Jul 2026 at 11:32, Wolfram Sang
> > <wsa+renesas@sang-engineering.com> wrote:
> >> To avoid more false positive reports of "leaking memory" when
> >> fops_buf_size_set() returns an error.
> >
> > But who is freeing priv->blob.data when fops_buf_size_set() succeeds?
>
> In case I was too eager picking it up, let me drop it from my tree before I
> pushed it out and wait for Wolfram's response.

Sorry for being unclear: the issue is pre-existing.
I don't object to this patch.

I don't see how "people" would come up with these bug reports,
but probably I am not smart enough to understand the logic of the AI ;-)

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] 6+ messages in thread

* Re: [PATCH] gpio: sloppy-logic-analyzer: add a comment explaining the buffer init
  2026-07-13  9:46   ` Bartosz Golaszewski
  2026-07-13 10:24     ` Geert Uytterhoeven
@ 2026-07-13 11:27     ` Wolfram Sang
  1 sibling, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2026-07-13 11:27 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Geert Uytterhoeven, linux-renesas-soc, Abdun Nihaal,
	Linus Walleij, linux-gpio

[-- Attachment #1: Type: text/plain, Size: 297 bytes --]


> >> To avoid more false positive reports of "leaking memory" when
> >> fops_buf_size_set() returns an error.
> >
> > But who is freeing priv->blob.data when fops_buf_size_set() succeeds?

This might be a separate issue. Will look later into it. The comment
added here still makes sense AFAICS.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2026-07-13 11:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-12  9:31 [PATCH] gpio: sloppy-logic-analyzer: add a comment explaining the buffer init Wolfram Sang
2026-07-13  8:22 ` Bartosz Golaszewski
2026-07-13  9:20 ` Geert Uytterhoeven
2026-07-13  9:46   ` Bartosz Golaszewski
2026-07-13 10:24     ` Geert Uytterhoeven
2026-07-13 11:27     ` Wolfram Sang

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