From: Ian Rogers <irogers@google.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Nathan Chancellor <nathan@kernel.org>,
linux-media@vger.kernel.org, llvm@lists.linux.dev,
linux-kernel@vger.kernel.org, Ian Rogers <irogers@google.com>,
Mehdi Djait <mehdi.djait@linux.intel.com>,
Michael Riesch <michael.riesch@collabora.com>,
Heiko Stuebner <heiko@sntech.de>,
Hans Verkuil <hverkuil+cisco@kernel.org>,
Gerald Loacker <gerald.loacker@wolfvision.net>,
"Bryan O'Donoghue" <bryan.odonoghue@linaro.org>,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org
Subject: [PATCH 2/5] media: rockchip: rkcif: Set .owner = THIS_MODULE in v4l2_file_operations
Date: Thu, 3 Dec 2026 09:15:44 -0800 [thread overview]
Message-ID: <20261203171549.438355-3-irogers@google.com> (raw)
In-Reply-To: <20261203171549.438355-1-irogers@google.com>
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@google.com>
---
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,
--
2.56.1.839.g22a8290db9-goog
next parent reply other threads:[~2026-12-03 17:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20261203171549.438355-1-irogers@google.com>
2026-12-03 17:15 ` Ian Rogers [this message]
2026-12-03 17:15 ` [PATCH 3/5] media: rkisp1: Set .owner = THIS_MODULE in v4l2_file_operations Ian Rogers
2026-12-03 17:15 ` [PATCH 5/5] media: sunxi: a83t-mipi-csi2: Set .owner = THIS_MODULE in phy_ops Ian Rogers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261203171549.438355-3-irogers@google.com \
--to=irogers@google.com \
--cc=bryan.odonoghue@linaro.org \
--cc=gerald.loacker@wolfvision.net \
--cc=heiko@sntech.de \
--cc=hverkuil+cisco@kernel.org \
--cc=hverkuil@kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=mehdi.djait@linux.intel.com \
--cc=michael.riesch@collabora.com \
--cc=nathan@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox