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: firefly_0821_release~7541^2~950 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e49068478916ea599765112c3cf3e31c520bce5c;p=firefly-linux-kernel-4.4.55.git media: dvb-core: Release semaphore on error path dvb_register_device() commit 82163edcdfa4eb3d74516cc8e9f38dd3d039b67d upstream. There is a missing "up_write()" here. Semaphore should be released before returning error value. Signed-off-by: Santosh Nayak Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c index f73287775953..d5cda35dcc7e 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; }