From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>,
Alison Schofield <amsfield22@gmail.com>
Cc: knaack.h@gmx.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org, Michael.Hennerich@analog.com,
gregkh@linuxfoundation.org, devel@driverdev.osuosl.org
Subject: Re: [PATCH v2] iio: trigger: free trigger resource correctly
Date: Sun, 22 Jan 2017 16:15:31 +0000 [thread overview]
Message-ID: <0b83f5da-1bd8-e6f4-2c58-498d353c6363@kernel.org> (raw)
In-Reply-To: <36545c61-0398-83b2-f89f-6c17c8e7d8cb@metafoo.de>
On 22/01/17 15:56, Lars-Peter Clausen wrote:
> On 01/22/2017 03:25 PM, Jonathan Cameron wrote:
>> On 20/01/17 03:47, Alison Schofield wrote:
>>> These stand-alone trigger drivers were using iio_trigger_put()
>>> where they should have been using iio_trigger_free(). The
>>> iio_trigger_put() adds a module_put which is bad since they
>>> never did a module_get.
>>>
>>> In the sysfs driver, module_get/put's are used as triggers are
>>> added & removed. This extra module_put() occurs on an error path
>>> in the probe routine (probably rare).
>>>
>>> In the bfin-timer & interrupt trigger drivers, the module resources
>>> are not explicitly managed, so it's doing a put on something that
>>> was never get'd. It occurs on the probe error path and on the
>>> remove path (not so rare).
>>>
>>> Tested with the sysfs trigger driver.
>>> The bfin & interrupt drivers were build tested & inspected only.
>>>
>>> Signed-off-by: Alison Schofield <amsfield22@gmail.com>
>> This is certainly more consistent.
>> Lars, could you sanity check as well given the bfin timer is
>> in here.
>
> looks good.
>
Applied to the togreg branch of iio.git.
Thought about sending this as a fix, but as it's been there a long
time I've taken the view there is no real rush on this.
Thanks,
Jonathan
prev parent reply other threads:[~2017-01-22 16:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-20 3:47 Alison Schofield
2017-01-22 14:25 ` Jonathan Cameron
2017-01-22 15:56 ` Lars-Peter Clausen
2017-01-22 16:15 ` Jonathan Cameron [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=0b83f5da-1bd8-e6f4-2c58-498d353c6363@kernel.org \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=amsfield22@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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
Powered by JetHome