aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter2012-11-27 10:35:09 -0600
committerGreg Kroah-Hartman2013-03-03 16:09:05 -0600
commit5dec43e3d688390256df3343bb444e7ed0022f44 (patch)
treec5342ce0fd35901e738a0a124773ac07b5ef9640
parentd6bf427fdac5fb26636d72f04289780a0ff2ca93 (diff)
downloadkernel-common-5dec43e3d688390256df3343bb444e7ed0022f44.tar.gz
kernel-common-5dec43e3d688390256df3343bb444e7ed0022f44.tar.xz
kernel-common-5dec43e3d688390256df3343bb444e7ed0022f44.zip
media: rc: unlock on error in show_protocols()
commit 30ebc5e44d057a1619ad63fe32c8c1670c37c4b8 upstream. We recently introduced a new return -ENODEV in this function but we need to unlock before returning. [mchehab@redhat.com: found two patches with the same fix. Merged SOB's/acks into one patch] Acked-by: Herton R. Krzesinski <herton.krzesinski@canonical.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Douglas Bagnall <douglas@paradise.net.nz> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/media/rc/rc-main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index 9cfb56d8cd8..62910ac90f6 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -775,8 +775,10 @@ static ssize_t show_protocols(struct device *device,
775 } else if (dev->raw) { 775 } else if (dev->raw) {
776 enabled = dev->raw->enabled_protocols; 776 enabled = dev->raw->enabled_protocols;
777 allowed = ir_raw_get_allowed_protocols(); 777 allowed = ir_raw_get_allowed_protocols();
778 } else 778 } else {
779 mutex_unlock(&dev->lock);
779 return -ENODEV; 780 return -ENODEV;
781 }
780 782
781 IR_dprintk(1, "allowed - 0x%llx, enabled - 0x%llx\n", 783 IR_dprintk(1, "allowed - 0x%llx, enabled - 0x%llx\n",
782 (long long)allowed, 784 (long long)allowed,