mirror of https://github.com/torvalds/linux.git
Multiple drivers that use v4l2_fh and call v4l2_fh_del() manually reset
the file->private_data pointer to NULL in their video device .release()
file operation handler. Move the code to the v4l2_fh_del() function to
avoid direct access to file->private_data in drivers. This requires
adding a file pointer argument to the function.
Changes to drivers have been generated with the following coccinelle
semantic patch:
@@
expression fh;
identifier filp;
identifier release;
type ret;
@@
ret release(..., struct file *filp, ...)
{
<...
- filp->private_data = NULL;
...
- v4l2_fh_del(fh);
+ v4l2_fh_del(fh, filp);
...>
}
@@
expression fh;
identifier filp;
identifier release;
type ret;
@@
ret release(..., struct file *filp, ...)
{
<...
- v4l2_fh_del(fh);
+ v4l2_fh_del(fh, filp);
...
- filp->private_data = NULL;
...>
}
@@
expression fh;
identifier filp;
identifier release;
type ret;
@@
ret release(..., struct file *filp, ...)
{
<...
- v4l2_fh_del(fh);
+ v4l2_fh_del(fh, filp);
...>
}
Manual changes have been applied to Documentation/ to update the usage
patterns, to drivers/media/v4l2-core/v4l2-fh.c to update the
v4l2_fh_del() prototype and reset file->private_data, and to
include/media/v4l2-fh.h to update the v4l2_fh_del() function prototype
and its documentation.
Additionally, white space issues have been fixed manually in
drivers/usb/gadget/function/uvc_v4l2.c
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
|
||
|---|---|---|
| .. | ||
| Kconfig | ||
| Makefile | ||
| vdec.c | ||
| venc.c | ||
| vpu.h | ||
| vpu_cmds.c | ||
| vpu_cmds.h | ||
| vpu_codec.h | ||
| vpu_color.c | ||
| vpu_core.c | ||
| vpu_core.h | ||
| vpu_dbg.c | ||
| vpu_defs.h | ||
| vpu_drv.c | ||
| vpu_helpers.c | ||
| vpu_helpers.h | ||
| vpu_imx8q.c | ||
| vpu_imx8q.h | ||
| vpu_malone.c | ||
| vpu_malone.h | ||
| vpu_mbox.c | ||
| vpu_mbox.h | ||
| vpu_msgs.c | ||
| vpu_msgs.h | ||
| vpu_rpc.c | ||
| vpu_rpc.h | ||
| vpu_v4l2.c | ||
| vpu_v4l2.h | ||
| vpu_windsor.c | ||
| vpu_windsor.h | ||