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>
Thu, 7 Aug 2014 05:26:38 +0000 (14:26 +0900)
commit42f08dc824b73c5b7e1615b9543ad8b1e87a556e
tree72b91294d7e8f544286dc774fa930bcafb667adc
parent99c83a93ecfdf5c0ee05c466492fa2ef37b574c9
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