linux/drivers/media/common/saa7146
Cyril Roelandt 21a73397c0 [media] media: saa7146: don't use mutex_lock_interruptible() in device_release()
Use uninterruptible mutex_lock in the release() file op to make sure all
resources are properly freed when a process is being terminated. Returning
-ERESTARTSYS has no effect for a terminating process and this may cause driver
resources not to be released.
This was found using the following semantic patch (http://coccinelle.lip6.fr/):
<spml>
@r@
identifier fops;
identifier release_func;
@@
static const struct v4l2_file_operations fops = {
.release = release_func
};
@depends on r@
identifier r.release_func;
expression E;
@@
static int release_func(...)
{
...
- if (mutex_lock_interruptible(E)) return -ERESTARTSYS;
+ mutex_lock(E);
...
}
</spml>

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-12-27 17:34:28 -02:00
..
Kconfig
Makefile
saa7146_core.c
saa7146_fops.c [media] media: saa7146: don't use mutex_lock_interruptible() in device_release() 2012-12-27 17:34:28 -02:00
saa7146_hlp.c
saa7146_i2c.c
saa7146_vbi.c
saa7146_video.c [media] v4l2: make vidioc_s_fbuf const 2012-09-26 10:42:36 -03:00