]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
media: rc: unlock on error in show_protocols()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 27 Nov 2012 16:35:09 +0000 (13:35 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Mar 2013 22:09:05 +0000 (06:09 +0800)
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>
drivers/media/rc/rc-main.c

index 9cfb56d8cd8258d94514bc12d869a4d676b6bed1..62910ac90f69dede3e7761145b527b7e759d5b57 100644 (file)
@@ -775,8 +775,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,