From patchwork Tue Aug 7 13:50:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [SRU, Oneiric/Precise, Quantal] UBUNTU: SAUCE: Unlock the rc_dev lock when the raw device is missing Date: Tue, 07 Aug 2012 03:50:51 -0000 From: Herton Ronaldo Krzesinski X-Patchwork-Id: 175635 Message-Id: <1344347451-4467-1-git-send-email-herton.krzesinski@canonical.com> To: kernel-team@lists.ubuntu.com From: Douglas Bagnall BugLink: http://bugs.launchpad.net/bugs/1015836 As pointed out by Ben Hutchings, after commit 720bb6436, the lock was being taken and not released when an rc_dev has a NULL raw device. Signed-off-by: Douglas Bagnall Reported-by: Ben Hutchings Signed-off-by: Herton Ronaldo Krzesinski --- drivers/media/rc/rc-main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Commit 720bb6436 missed an mutex_unlock on exit, thanks to Ben Hutchings for pointing that out. Marked as "SAUCE" since it's not upstream yet, but it should be included upstream. diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index cabc19c..dcd45d0 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c @@ -778,9 +778,10 @@ static ssize_t show_protocols(struct device *device, } else if (dev->raw) { enabled = dev->raw->enabled_protocols; allowed = ir_raw_get_allowed_protocols(); - } else + } else { + mutex_unlock(&dev->lock); return -ENODEV; - + } IR_dprintk(1, "allowed - 0x%llx, enabled - 0x%llx\n", (long long)allowed, (long long)enabled);