OSDN Git Service

[media] rc-main: fix missing unlock if no devno left
authorJames Hogan <james.hogan@imgtec.com>
Sat, 1 Mar 2014 22:52:25 +0000 (19:52 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 11 Mar 2014 18:56:32 +0000 (15:56 -0300)
commit262912335c823a2bbcc87003ee55d62cc27f4e48
tree90ad93d575245b05bd1f9b479848995d09aada45
parentcdcb12e78a4559c1842fbf8fb82e770b9f7362d6
[media] rc-main: fix missing unlock if no devno left

While playing with make coccicheck I noticed this message:
drivers/media/rc/rc-main.c:1245:3-9: preceding lock on line 1238

It was introduced by commit 587d1b06e07b ([media] rc-core: reuse device
numbers) which returns -ENOMEM after a mutex_lock without first
unlocking it when there are no more device numbers left. The added code
doesn't depend on the device lock, so move it before the lock is taken.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/rc/rc-main.c