rc: unlock on error in show_protocols()
Subsystems (3)
PATCH 1/2 rc: unlock on error in show_protocols()
We recently introduced a new return -ENODEV in this function but we need to unlock before returning.
Signed-off-by Dan Carpenter <[email protected]>
drivers/media/rc/rc-main.c +3 -1
@@ -789,8 +789,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,
Quoted 2 lines · Dan Carpenter
We recently introduced a new return
-ENODEVin this function but we need to unlock before returning.
There is an identical patch here (scroll down):
https://patchwork.kernel.org/patch/1284081/
I'm not sure what happened to it.
Douglas
Quoted 19 lines
Signed-off-by Dan Carpenter <[email protected]>drivers/media/rc/rc-main.c +3
-1@@ -789,8 +789,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,