Thread (3 messages) 3 messages, 3 authors, 2012-12-25

Re: [PATCH] rc-core: don't return from store_protocols without releasing device mutex

From: David Härdeman <david@hardeman.nu>
Date: 2012-12-25 16:46:14
Also in: lkml

On Sat, Dec 08, 2012 at 07:50:50AM -0500, Sasha Levin wrote:
Commit c003ab1b ("[media] rc-core: add separate defines for protocol bitmaps
and numbers") has introduced a bug which allows store_protocols() to return
without releasing the device mutex it's holding.

Doing that would cause infinite hangs waiting on device mutex next time
around.

Signed-off-by: Sasha Levin <redacted>
Acked-by: David Härdeman <david@hardeman.nu>
quoted hunk ↗ jump to hunk
---
drivers/media/rc/rc-main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index 601d1ac1..0510f4d 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -890,7 +890,8 @@ static ssize_t store_protocols(struct device *device,
		if (i == ARRAY_SIZE(proto_names)) {
			IR_dprintk(1, "Unknown protocol: '%s'\n", tmp);
-			return -EINVAL;
+			ret = -EINVAL;
+			goto out;
		}

		count++;
-- 
1.8.0
-- 
David Härdeman
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help