[PATCH] [media] Unlock the rc_dev lock when the raw device is missing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/08/12 04:10, Herton Ronaldo Krzesinski wrote:
> As it's desired for stable, this could also have
> "Cc: stable@xxxxxxxxxxxxxxx" when applied, so it's picked up
> "automatically" when lands in mainline. Also nitpicking some more,
> may be the patch could have a Reported-by line added.

OK. Here it is again, with CC: stable, Reported-by Ben, and Herton's
Acked-by.

thanks,

Douglas

>From 47aadfdaa5a6e5c3d8f1bf2b5be4c4a4156085ee Mon Sep 17 00:00:00 2001
From: Douglas Bagnall <douglas@xxxxxxxxxxxxxxx>
Date: Tue, 7 Aug 2012 19:30:36 +1200
Subject: [PATCH] Unlock the rc_dev lock when the raw device is missing

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.

Cc: <stable@xxxxxxxxxxxxxxx>
Reported-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
Signed-off-by: Douglas Bagnall <douglas@xxxxxxxxxxxxxxx>
Acked-by: Herton R. Krzesinski <herton.krzesinski@xxxxxxxxxxxxx>
---
 drivers/media/rc/rc-main.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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);
-- 
1.7.9.5



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux