Re: [PATCH v2] clk: Fix memory leak in devm_clk_notifier_register()

From: Dan Carpenter
Date: Mon Jun 19 2023 - 05:58:13 EST


On Mon, Jun 19, 2023 at 12:24:41PM +0300, Dan Carpenter wrote:
> > It was actually detected by kmemleak on an unreleased Chromebook device.
> > I added the trace snippet in the message at first but removed that
> > before sending this. Maybe I shouldn't have.
> >
> > I can resend a v3 to add that back if that's preferable. What do you think?

The other reason to include stack traces is so that if someone else
runs into the same bug they can find your patch by googling their stack
trace.

Normal users aren't going to be running kmemleak. And people doing
testing work for companies are hopefully going to pull this fix in via
the stable tree so they'll get this patch automatically that way so
they won't see it either.

But if the stack trace is like a NULL dereference bug, then users
absolutely do notice that kind of thing. You should always include
those kind of stack traces.

regards,
dan carpenter