Commit ffeb9ec7 authored by Andrew Morton's avatar Andrew Morton Committed by Mauro Carvalho Chehab

V4L/DVB (5699): Cinergyt2: fix file release handler

If this mutex_lock_interruptible() does fail due to signal_pending() then the
state of the driver will get trashed in interesting ways, because userspace
cannot and will not retry the close().
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 624fc7f5
......@@ -519,8 +519,7 @@ static int cinergyt2_release (struct inode *inode, struct file *file)
struct dvb_device *dvbdev = file->private_data;
struct cinergyt2 *cinergyt2 = dvbdev->priv;
if (mutex_lock_interruptible(&cinergyt2->sem))
return -ERESTARTSYS;
mutex_lock(&cinergyt2->sem);
if (!cinergyt2->disconnect_pending && (file->f_flags & O_ACCMODE) != O_RDONLY) {
cancel_delayed_work(&cinergyt2->query_work);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment