Skip to content

Commit 30ebc5e

Browse files
Dan CarpenterMauro Carvalho Chehab
authored andcommitted
[media] rc: unlock on error in show_protocols()
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> Cc: stable@vger.kernel.org Signed-off-by: Douglas Bagnall <douglas@paradise.net.nz> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
1 parent 45b8259 commit 30ebc5e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/media/rc/rc-main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,8 +789,10 @@ static ssize_t show_protocols(struct device *device,
789789
} else if (dev->raw) {
790790
enabled = dev->raw->enabled_protocols;
791791
allowed = ir_raw_get_allowed_protocols();
792-
} else
792+
} else {
793+
mutex_unlock(&dev->lock);
793794
return -ENODEV;
795+
}
794796

795797
IR_dprintk(1, "allowed - 0x%llx, enabled - 0x%llx\n",
796798
(long long)allowed,

0 commit comments

Comments
 (0)