Re: [PATCH 2/5] media: rockchip: rkcif: Set .owner = THIS_MODULE in v4l2_file_operations

From: Michael Riesch

Date: Fri Dec 04 2026 - 03:21:26 EST


Hi Ian,

Thanks for your patch!

On 12/3/26 18:15, Ian Rogers wrote:
> 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 rkcif_stream_file_ops, found with Clang's
> require_explicit_initialization attribute.
>
> Fixes: 501802e2ad51 ("media: rockchip: rkcif: add abstraction for dma blocks")
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>

Reviewed-by: Michael Riesch <michael.riesch@xxxxxxxxxxxxx>

Best regards,
Michael

> ---
> drivers/media/platform/rockchip/rkcif/rkcif-stream.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/rockchip/rkcif/rkcif-stream.c b/drivers/media/platform/rockchip/rkcif/rkcif-stream.c
> index 3130d420ad55..329c38d284f1 100644
> --- a/drivers/media/platform/rockchip/rkcif/rkcif-stream.c
> +++ b/drivers/media/platform/rockchip/rkcif/rkcif-stream.c
> @@ -506,6 +506,7 @@ static const struct v4l2_file_operations rkcif_stream_file_ops = {
> .unlocked_ioctl = video_ioctl2,
> .poll = vb2_fop_poll,
> .mmap = vb2_fop_mmap,
> + .owner = THIS_MODULE,
> };
>
> static int rkcif_stream_init_vb2_queue(struct vb2_queue *q,