Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH 4/5] staging: media: ipu3: Set .owner = THIS_MODULE in v4l2_file_operations
       [not found] <20261203171549.438355-1-irogers@google.com>
@ 2026-12-03 17:15 ` Ian Rogers
  0 siblings, 0 replies; only message in thread
From: Ian Rogers @ 2026-12-03 17:15 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Hans Verkuil, Sakari Ailus,
	Laurent Pinchart
  Cc: Nathan Chancellor, linux-media, llvm, linux-kernel, Ian Rogers,
	Greg Kroah-Hartman, Yong Zhi, linux-staging

video_register_device() passes vdev->fops->owner to
__video_register_device(), which sets vdev->cdev->owner = owner so
chrdev_open() pins the V4L2 driver module while the device node is open.
When .owner is omitted in a const struct v4l2_file_operations,
vdev->cdev->owner is NULL and the driver module is not reference counted
on open().

Set .owner = THIS_MODULE in imgu_v4l2_fops, found with Clang's
require_explicit_initialization attribute.

Fixes: a0ca1627b450 ("media: staging/intel-ipu3: Add v4l2 driver based on media framework")
Signed-off-by: Ian Rogers <irogers@google.com>
---
 drivers/staging/media/ipu3/ipu3-v4l2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c b/drivers/staging/media/ipu3/ipu3-v4l2.c
index 61fdefe78c3d..12b808c2bf7e 100644
--- a/drivers/staging/media/ipu3/ipu3-v4l2.c
+++ b/drivers/staging/media/ipu3/ipu3-v4l2.c
@@ -951,6 +951,7 @@ static const struct v4l2_file_operations imgu_v4l2_fops = {
 	.release = vb2_fop_release,
 	.poll = vb2_fop_poll,
 	.mmap = vb2_fop_mmap,
+	.owner = THIS_MODULE,
 };
 
 /******************** v4l2_ioctl_ops ********************/
-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-12-03 17:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20261203171549.438355-1-irogers@google.com>
2026-12-03 17:15 ` [PATCH 4/5] staging: media: ipu3: Set .owner = THIS_MODULE in v4l2_file_operations Ian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox