From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.200 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796318193; b=P2UlB+RtRMaKnYPoZ6rKS0iyfNfsb+JbrSzEUk56ZfNonY8U1ELD/FuiEmWKIAKhHT0G ASKJo9p2NFt6YtiGF9p3klK+/qQaSf3zSDKEciwCw8+mCUxBPF9Sb8fHD2nNC9dse3bg4 YlWW1uO+BSQ+z0LrPw/SnyjV3ycgpgAzP6VfG8KlC1t2Kfu6xoDx4w77I50dLUnohWnpe QfYBUIErSxpoIh8HUrOZE3wb/uvhxzGcgwd4bHSRBztRHH2TLCoUnm4AEjGWNm+Qk4Kby QHrBEp9Q32M8CQwNvh4TO3Tmb9D0T9Otzw8ZLp4rzAyLc8DwjobWDhk4lwbuk9o5NBQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796318193; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:X-Mailer:Message-ID:Subject:From:To:Cc: Content-Type; bh=C/CDZELtf1Qn+xgekwaFKQVKW6bjV3IQjze7b01pdHU=; b=J+7TAfyzB6GExwJeSteAfEJPZt/RM5eAOJFENhcCXHJ+sl9hELEEg98lfH8eUJnI21Sa VWNs2GYTIvuuRE05EkdyYqBrew9L4E9nRr05W+5hefoGd/nfSQTO97916iyYwTVb+bWfR crPn5FLcOQgrFRrrT0TIfP8VocjyTvYsjE0ejKk23932HlZFJbu1Cp9ixZZcgp/ijFKJO A0CMJorMIo4G3uIB4tQL5ymV2BjSxtljAvnfywAtm2Xt+nwxrt26pI3JDSxBz3gxFo+1u RUNG9isAhrQH48zS8o65ldTZ4IzGoW+vdnnAFiUCzIBBwP16qgo4eF8kX4+gBPEZgMA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=em6cvNuw; arc=none smtp.remote-ip=74.125.82.200 Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88765606A332 for ; Thu, 3 Dec 2026 17:16:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 88765606A332 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=em6cvNuw Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-38355b03cb8so13776451eec.0 for ; Thu, 03 Dec 2026 09:16:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796318193; x=1796922993; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=C/CDZELtf1Qn+xgekwaFKQVKW6bjV3IQjze7b01pdHU=; b=em6cvNuwmPelU4hYqvDlKMxc48E1Kyt67wrMFQXrpXmVVwUcP7Rr222CTQJ4LfX60Z LSzx0P+5Xv2ywmI3Bge+TII9wdvHFmHGD9wefCN9AMRKn0vAE86OEbeiKiLtNnxkJaXx OqdINmwDfb4fr2TC0h5Bkx5W4/W+XJnjlxPDLufFB7FFU5TKwPlhC6LiLOMnoogL8IFR ZapFSPERt5U3Bj4x/mRo9knlSrG1gMW6KLBBs6/yqK7hvlJUIS3wjO6CUqn1146hX35n +HLlErqBXx2WUC7RAEClJPx5x6KiRImK7gyLY0mDuw3/WdkyJsKEQJs0U50ErzyMbC1X vX2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796318193; x=1796922993; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=C/CDZELtf1Qn+xgekwaFKQVKW6bjV3IQjze7b01pdHU=; b=KA9nNUPMevUePUcyJQZjm2ZNk+rDIG9nBMgHUJJl017jbF9ZjcWrO+acBmJ+hk3uAb O52RjJqSD3ILHVH2bO2BfVYAk9pMjqP30Za0iOUcs4cPKOn1p48Mz4v0wo8sPfhdN0Uh JP9+iwuGc3E6hDYksl62n686dxps00e9eqjqGxmaKrWS1XQoHrUs0fNqZ5vLh8Z9CJDQ gPAtfmm5ay2tQgPIkDvPHUbODmRQBgwJtfRwMGbz1+cRA6C4f9OVNoV0CUZfJ0AkDAK8 0NzP0tew7rwU7CiB82FwOFx4zqmNIiQ4nxkVNsu6QyMwWUy0dVmbYlhjyBBd+EZUA0LI QE7Q== X-Forwarded-Encrypted: i=1; AL+hErF9/RMqCF0A759I8p/g2IYQ88bfXfGkzjvxHIpBPpxu9IkiBRdwFjYnwIfOT49i6/AsT4nqNwlG4UFFskI=@vger.kernel.org X-Gm-Message-State: APuU4Z/J669KX+q0jWoEKWN7D45nURHtG2JXPtl/YCVpZMoHOAbJjm9Q X0Lp9ivDsr8aWUkPTdEwo+5Jb865bSb46/q+6ewSyyk7HxbG6U3wDNFc5p7AzfycaXG7Jm8KnEp cZEoJA4/vfg== X-Received: from dycf22.prod.google.com ([2002:a05:7300:50d6:b0:36a:1f25:64f4]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7300:c01b:10b0:386:c3c2:a37b with SMTP id 5a478bee46e88-386c3c2a444mr34336454eec.4.1796318192423; Thu, 03 Dec 2026 09:16:32 -0800 (PST) Date: Thu, 3 Dec 2026 09:15:43 -0800 In-Reply-To: <20261203171549.438355-1-irogers@google.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261203171549.438355-1-irogers@google.com> X-Mailer: git-send-email 2.56.1.911.g883d8bcb20-goog Message-ID: <20261203171549.438355-2-irogers@google.com> Subject: [PATCH 1/5] media: amlogic: c3-isp: Set .owner = THIS_MODULE in v4l2_file_operations From: Ian Rogers To: Mauro Carvalho Chehab , Hans Verkuil , Sakari Ailus , Laurent Pinchart Cc: Nathan Chancellor , linux-media@vger.kernel.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Ian Rogers , Keke Li , Jacopo Mondi Content-Type: text/plain; charset="UTF-8" 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 isp_cap_v4l2_fops, isp_params_v4l2_fops, and isp_stats_v4l2_fops, found with Clang's require_explicit_initialization attribute. Fixes: fb2e135208f3 ("media: platform: Add C3 ISP driver") Signed-off-by: Ian Rogers --- drivers/media/platform/amlogic/c3/isp/c3-isp-capture.c | 1 + drivers/media/platform/amlogic/c3/isp/c3-isp-params.c | 1 + drivers/media/platform/amlogic/c3/isp/c3-isp-stats.c | 1 + 3 files changed, 3 insertions(+) diff --git a/drivers/media/platform/amlogic/c3/isp/c3-isp-capture.c b/drivers/media/platform/amlogic/c3/isp/c3-isp-capture.c index 11d85f5342f0..da0506548d34 100644 --- a/drivers/media/platform/amlogic/c3/isp/c3-isp-capture.c +++ b/drivers/media/platform/amlogic/c3/isp/c3-isp-capture.c @@ -502,6 +502,7 @@ static const struct v4l2_file_operations isp_cap_v4l2_fops = { .poll = vb2_fop_poll, .unlocked_ioctl = video_ioctl2, .mmap = vb2_fop_mmap, + .owner = THIS_MODULE, }; static int c3_isp_cap_link_validate(struct media_link *link) diff --git a/drivers/media/platform/amlogic/c3/isp/c3-isp-params.c b/drivers/media/platform/amlogic/c3/isp/c3-isp-params.c index ae0777a20bda..686f22c99d69 100644 --- a/drivers/media/platform/amlogic/c3/isp/c3-isp-params.c +++ b/drivers/media/platform/amlogic/c3/isp/c3-isp-params.c @@ -764,6 +764,7 @@ static const struct v4l2_file_operations isp_params_v4l2_fops = { .poll = vb2_fop_poll, .unlocked_ioctl = video_ioctl2, .mmap = vb2_fop_mmap, + .owner = THIS_MODULE, }; static int c3_isp_params_vb2_queue_setup(struct vb2_queue *q, diff --git a/drivers/media/platform/amlogic/c3/isp/c3-isp-stats.c b/drivers/media/platform/amlogic/c3/isp/c3-isp-stats.c index 8a5d7e1a30c9..888a4a6434e8 100644 --- a/drivers/media/platform/amlogic/c3/isp/c3-isp-stats.c +++ b/drivers/media/platform/amlogic/c3/isp/c3-isp-stats.c @@ -140,6 +140,7 @@ static const struct v4l2_file_operations isp_stats_v4l2_fops = { .poll = vb2_fop_poll, .unlocked_ioctl = video_ioctl2, .mmap = vb2_fop_mmap, + .owner = THIS_MODULE, }; static int c3_isp_stats_vb2_queue_setup(struct vb2_queue *q, -- 2.56.1.839.g22a8290db9-goog