From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: linux-kernel@vger.kernel.org, Stephen Boyd <sboyd@codeaurora.org>,
Mike Turquette <mturquette@linaro.org>,
Lee Jones <lee@kernel.org>,
Bryan Huntsman <bryanh@codeaurora.org>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Ralf Baechle <ralf@linux-mips.org>,
Sylwester Nawrocki <s.nawrocki@samsung.com>,
Tomeu Vizoso <tomeu.vizoso@collabora.com>
Subject: Re: [PATCH v4 1/1] clkdev: change prototype of clk_register_clkdev()
Date: Fri, 08 May 2015 14:01:03 +0300 [thread overview]
Message-ID: <1431082863.28073.19.camel@linux.intel.com> (raw)
In-Reply-To: <20150506125128.GU2067@n2100.arm.linux.org.uk>
On Wed, 2015-05-06 at 13:51 +0100, Russell King - ARM Linux wrote:
> On Wed, May 06, 2015 at 03:34:09PM +0300, Andy Shevchenko wrote:
> > On Wed, 2015-05-06 at 12:09 +0100, Russell King - ARM Linux wrote:
> > > On Wed, May 06, 2015 at 01:24:12PM +0300, Andy Shevchenko wrote:
> > > > Since clk_register_clkdev() is exported for modules the caller should get a
> > > > pointer to the allocated resources. Otherwise the memory leak is guaranteed on
> > > > the ->remove() stage.
> > >
> > > clk_register_clkdev() is there to assist mass clock registrations, which
> > > typically happen in platform code. It's there to simplify the "I need
> > > to register this clock which I'm not going to release again".
> > >
> > > I don't see any of these locations trying to unregister their clk from
> > > clkdev, so I doubt this patch is needed.
> >
> > We are doing the driver which will use this (as I mentioned in the cover
> > letter).
> >
> > >
> > > Where a module wants to remove its clk from clkdev, it should register
> > > its clk with clkdev_create() and remove it with clkdev_drop().
> > >
> >
> > You are talking about something in the wild? I can't find
> > clkdev_create() neither in current clk.git nor in linux-next.git.
>
> It'll be in linux-next RSN.
>
> Search lakml for "Fix fallout from per-user struct clk patches"
>
Thanks, we will use it, though the documentation might say that there is
a risk of memory leak in case of usage clk_register_clkdev().
--
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy
prev parent reply other threads:[~2015-05-08 11:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-06 10:24 [PATCH v4 0/1] clkdev: prevent potential memory leak when used in modules Andy Shevchenko
2015-05-06 10:24 ` [PATCH v4 1/1] clkdev: change prototype of clk_register_clkdev() Andy Shevchenko
2015-05-06 11:09 ` Russell King - ARM Linux
2015-05-06 12:34 ` Andy Shevchenko
2015-05-06 12:51 ` Russell King - ARM Linux
2015-05-08 11:01 ` Andy Shevchenko [this message]
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=1431082863.28073.19.camel@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=bryanh@codeaurora.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=lorenzo.pieralisi@arm.com \
--cc=mturquette@linaro.org \
--cc=ralf@linux-mips.org \
--cc=s.nawrocki@samsung.com \
--cc=sboyd@codeaurora.org \
--cc=tomeu.vizoso@collabora.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.