[PATCH 4/5] staging: media: ipu3: Set .owner = THIS_MODULE in v4l2_file_operations
From: Ian Rogers
Date: Thu Dec 03 2026 - 12:17:03 EST
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@xxxxxxxxxx>
---
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