linux/drivers/media/common
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
..
b2c2 [media] common/*/Kconfig: Remove unused helps 2012-10-17 16:59:13 -03:00
saa7146 [media] media: saa7146: don't use mutex_lock_interruptible() in device_release() 2012-12-27 17:34:28 -02:00
siano [media] siano: fix build with allmodconfig 2012-11-23 13:48:39 -02:00
Kconfig [media] siano: allow compiling it without RC support 2012-10-17 16:59:01 -03:00
Makefile [media] siano: break it into common, mmc and usb 2012-08-13 23:52:52 -03:00