public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Dhruva Gole <d-gole@ti.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Chanwoo Choi <cw00.choi@samsung.com>, <linux-pm@vger.kernel.org>,
	<stable@vger.kernel.org>
Subject: Re: [PATCH] PM / devfreq: Fix leak in devfreq_dev_release()
Date: Thu, 10 Aug 2023 08:49:42 +0200	[thread overview]
Message-ID: <20230810084942.3769c5d1@collabora.com> (raw)
In-Reply-To: <20230810052109.q2urzfcwu2vly7b5@dhruva>

On Thu, 10 Aug 2023 10:51:09 +0530
Dhruva Gole <d-gole@ti.com> wrote:

> On Aug 09, 2023 at 13:31:08 +0200, Boris Brezillon wrote:
> > srcu_init_notifier_head() allocates resources that need to be released
> > with a srcu_cleanup_notifier_head() call.
> > 
> > Reported by kmemleak.  
> 
> Probably want to give a proper mention like:
> 	Reported-by: Name <email-id>
> ?

Does kmemleak have a standard Reported-by tag? Otherwise, the reported
is me (ran kmemleak when developing a driver, and this showed up), and
since I'm also the one fixing the bug, I'm not sure it's worth
mentioning.

> 
> > 
> > Fixes: 0fe3a66410a3 ("PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier")
> > Cc: <stable@vger.kernel.org>
> > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> > ---
> >  drivers/devfreq/devfreq.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> > index e36cbb920ec8..9464f8d3cb5b 100644
> > --- a/drivers/devfreq/devfreq.c
> > +++ b/drivers/devfreq/devfreq.c
> > @@ -763,6 +763,7 @@ static void devfreq_dev_release(struct device *dev)
> >  		dev_pm_opp_put_opp_table(devfreq->opp_table);
> >  
> >  	mutex_destroy(&devfreq->lock);
> > +	srcu_cleanup_notifier_head(&devfreq->transition_notifier_list);  
> 
> Good catch!
> Reviewed-by: Dhruva Gole <d-gole@ti.com>
> 
> >  	kfree(devfreq);
> >  }
> >  
> > -- 
> > 2.41.0
> >   
> 


  reply	other threads:[~2023-08-10  6:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09 11:31 [PATCH] PM / devfreq: Fix leak in devfreq_dev_release() Boris Brezillon
2023-08-10  5:21 ` Dhruva Gole
2023-08-10  6:49   ` Boris Brezillon [this message]
2023-08-10 13:50 ` Chanwoo Choi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230810084942.3769c5d1@collabora.com \
    --to=boris.brezillon@collabora.com \
    --cc=cw00.choi@samsung.com \
    --cc=d-gole@ti.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox