upstream: [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)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:58:50 +0000 (11:58 +0900)
commit0cd328484cf600665144fc5f10886813874308a5
treee44e064437f6f151a196c32670d05798d345cea6
parent02c4792496b89bd40d729fe1aa79e1da3eaed031
upstream: [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