From: Santosh Nayak Date: Sat, 23 Jun 2012 10:59:54 +0000 (-0300) Subject: [media] dvb-core: Release semaphore on error path dvb_register_device() X-Git-Tag: next-20120724~79^2~6^2~14 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6e382c509c112324746d493998d5fdc8262da509;p=karo-tx-linux.git [media] dvb-core: Release semaphore on error path dvb_register_device() There is a missing "up_write()" here. Semaphore should be released before returning error value. Cc: stable@kernel.org Signed-off-by: Santosh Nayak Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c index 00a67326c193..39eab73b01ae 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.c +++ b/drivers/media/dvb/dvb-core/dvbdev.c @@ -243,6 +243,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, if (minor == MAX_DVB_MINORS) { kfree(dvbdevfops); kfree(dvbdev); + up_write(&minor_rwsem); mutex_unlock(&dvbdev_register_lock); return -EINVAL; }