From: "David Härdeman" <david@hardeman.nu>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: mchehab@redhat.com, linux-media@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rc-core: don't return from store_protocols without releasing device mutex
Date: Tue, 25 Dec 2012 17:40:21 +0100 [thread overview]
Message-ID: <20121225164021.GA13852@hardeman.nu> (raw)
In-Reply-To: <1354971050-5784-1-git-send-email-sasha.levin@oracle.com>
On Sat, Dec 08, 2012 at 07:50:50AM -0500, Sasha Levin wrote:
>Commit c003ab1b ("[media] rc-core: add separate defines for protocol bitmaps
>and numbers") has introduced a bug which allows store_protocols() to return
>without releasing the device mutex it's holding.
>
>Doing that would cause infinite hangs waiting on device mutex next time
>around.
>
>Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Acked-by: David Härdeman <david@hardeman.nu>
>---
> drivers/media/rc/rc-main.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
>index 601d1ac1..0510f4d 100644
>--- a/drivers/media/rc/rc-main.c
>+++ b/drivers/media/rc/rc-main.c
>@@ -890,7 +890,8 @@ static ssize_t store_protocols(struct device *device,
>
> if (i == ARRAY_SIZE(proto_names)) {
> IR_dprintk(1, "Unknown protocol: '%s'\n", tmp);
>- return -EINVAL;
>+ ret = -EINVAL;
>+ goto out;
> }
>
> count++;
>--
>1.8.0
>
--
David Härdeman
prev parent reply other threads:[~2012-12-25 16:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-08 12:50 [PATCH] rc-core: don't return from store_protocols without releasing device mutex Sasha Levin
2012-12-20 16:39 ` Sasha Levin
2012-12-25 16:40 ` David Härdeman [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=20121225164021.GA13852@hardeman.nu \
--to=david@hardeman.nu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@redhat.com \
--cc=sasha.levin@oracle.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;
as well as URLs for NNTP newsgroup(s).