From: James Hogan <james.hogan@imgtec.com>
To: Sifan Naeem <sifan.naeem@imgtec.com>
Cc: <mchehab@osg.samsung.com>, <linux-kernel@vger.kernel.org>,
<linux-media@vger.kernel.org>
Subject: Re: [PATCH] rc: img-ir: fix error in parameters passed to irq_free()
Date: Tue, 10 Feb 2015 12:04:10 +0000 [thread overview]
Message-ID: <20150210120410.GM30459@jhogan-linux.le.imgtec.org> (raw)
In-Reply-To: <1423564916-29805-1-git-send-email-sifan.naeem@imgtec.com>
[-- Attachment #1: Type: text/plain, Size: 1846 bytes --]
On Tue, Feb 10, 2015 at 10:41:56AM +0000, Sifan Naeem wrote:
> img_ir_remove() passes a pointer to the ISR function as the 2nd
> parameter to irq_free() instead of a pointer to the device data
> structure.
> This issue causes unloading img-ir module to fail with the below
> warning after building and loading img-ir as a module.
>
> WARNING: CPU: 2 PID: 155 at ../kernel/irq/manage.c:1278
> __free_irq+0xb4/0x214() Trying to free already-free IRQ 58
> Modules linked in: img_ir(-)
> CPU: 2 PID: 155 Comm: rmmod Not tainted 3.14.0 #55 ...
> Call Trace:
> ...
> [<8048d420>] __free_irq+0xb4/0x214
> [<8048d6b4>] free_irq+0xac/0xf4
> [<c009b130>] img_ir_remove+0x54/0xd4 [img_ir] [<8073ded0>]
> platform_drv_remove+0x30/0x54 ...
>
> Signed-off-by: Sifan Naeem <sifan.naeem@imgtec.com>
> Fixes: 160a8f8aec4d ("[media] rc: img-ir: add base driver")
> Cc: <stable@vger.kernel.org> # 3.15+
Thanks for catching this Sifan. It appears to have been introduced while
getting the driver ready for upstream (it used to use the devm_* API to
request the IRQ, but I changed it to avoid the ISR racing with module
removal).
Acked-by: James Hogan <james.hogan@imgtec.com>
Cheers
James
> ---
> drivers/media/rc/img-ir/img-ir-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/rc/img-ir/img-ir-core.c b/drivers/media/rc/img-ir/img-ir-core.c
> index 77c78de..7020659 100644
> --- a/drivers/media/rc/img-ir/img-ir-core.c
> +++ b/drivers/media/rc/img-ir/img-ir-core.c
> @@ -146,7 +146,7 @@ static int img_ir_remove(struct platform_device *pdev)
> {
> struct img_ir_priv *priv = platform_get_drvdata(pdev);
>
> - free_irq(priv->irq, img_ir_isr);
> + free_irq(priv->irq, priv);
> img_ir_remove_hw(priv);
> img_ir_remove_raw(priv);
>
> --
> 1.7.9.5
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2015-02-10 12:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-10 10:41 Sifan Naeem
2015-02-10 12:04 ` James Hogan [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=20150210120410.GM30459@jhogan-linux.le.imgtec.org \
--to=james.hogan@imgtec.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
--cc=sifan.naeem@imgtec.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®