V4L/DVB (5400): Core: fix several locking related problems
authorSimon Arlott <simon@fire.lp0.eu>
Sat, 10 Mar 2007 09:21:25 +0000 (06:21 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Tue, 27 Mar 2007 11:45:54 +0000 (08:45 -0300)
commitc278850206fd9df0bb62a72ca0b277fe20c5a452
tree439ae68737b5bcb5d473b3d12c3d5417f697ccb3
parentb10fece583fdfdb3d2f29b0da3896ec58b8fe122
V4L/DVB (5400): Core: fix several locking related problems

Fix several instances of dvb-core functions using mutex_lock_interruptible
and returning -ERESTARTSYS where the calling function will either never
retry or never check the return value.
These cause a race condition with dvb_dmxdev_filter_free and
dvb_dvr_release, both of which are filesystem release functions whose
return value is ignored and will never be retried.  When this happens it
becomes impossible to open dvr0 again (-EBUSY) since it has not been
released properly.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-By: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/dvb/dvb-core/dmxdev.c
drivers/media/dvb/dvb-core/dvb_demux.c
drivers/media/dvb/dvb-core/dvbdev.c