From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.198 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796318194; b=cEHaShHZu0jbovT8SHyrS0T0TrmdQgqdQRxxCwyI/RpAqhimaZG00YJNkD5MAGpELTV6 ORhb4VxyaQuh3YYdWFjadmbgZzw4/PanzZWhVf7joGYuNffpBYZ1iyWUV/a0lzPjbUCMX vz5uS3V4HEfBytc+OyiDBTKf4b6CmvbhqBPDkLq2r149gPJrxskCFtulo1YapoyZTXWyk 9nvCUeO6ObVefFi5UhqzJ+j99R+cUhEyq8Vpf2vV1cjPYw0E/LztXLgGJEki7AhwVJwdB ONmJTHaAop4AgWRSPI1uyLE55yWfnLfBWCT8nwGyGkjHchppuJGpVvKyo+M3npjpwmA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796318194; 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=bTlYWpUfLuVnUrEqnmcmoUlFbZOKyISpqSvzSUCsS8DmEwjuSSl5zL5fm7BRJz3kM5Vb +iufR0XFveQDF3P2ImMiW+V5m+o6D5HGRBJ5doDugnwtaV750iiFnyxA0VaV97DNtGulh ehRvcYBhzzQbJShn+a3YPvFDgVqf9O9LWXEtMBMhhyv7TTVglMLqSs5Hcryw/sJ8xWDcd cbrqQog9MDXG6/xVtzJZF3aufYK1PPDYfaKSGqOMPsLQ/ZilvM+KM6CbZ8yt+82Unf+DK qr9+Zk1AZuYYtRW5Jd0uCtcicpLUwJD823xocfrkcrCFyd51TRtfSzr5xJBTA1oYwlQ== 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=nXbqUnA3; arc=none smtp.remote-ip=74.125.82.198 Received: from mail-dy1-f198.google.com (mail-dy1-f198.google.com [74.125.82.198]) (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 B68DD606A337 for ; Thu, 3 Dec 2026 17:16:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B68DD606A337 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=nXbqUnA3 Received: by mail-dy1-f198.google.com with SMTP id 5a478bee46e88-38355b03cb8so13776454eec.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=lists.linux.dev; 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=nXbqUnA3YWFoXnlVQFiUpKbTmSDy159NL3NTBGw1TNtGQFZYnyhm/QgeJNyz1HUMXd uejcqxrlhhf3/Tx+bU+xn2dDAKpmtHkSKguLam1Ohs1ZwK13wOHIAYS3hFwigGw0CRd/ Ertj5I/UASJ3MVjYcVrq5hJHRBg46ZAvF8JVVLg4TmlxpFEEAMVgr/cTOg1uj8RYQBq+ oKX4Xo+7IZi1q8qnIZeC/S87+0Q7TV8Oge8CD5sGzhw5kNY2yl44XKs9fcIKjZCKKknn v9SokNQ37JlO/bvRuI9P0q8ytWXde0mFxAh4mFVDq+K1ZIp6ch2kw/oF1Frc73CRJcXT l2+A== 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=KAx0FJYA5Wu/v0EPgYAi8z0cM6yee5OzFcQoTv5GOqw+z0BJDMYo+A55Mbuv/XtDJb IfATBdSkw/CIVzW26qpMxWK9YFhwez4eBmr4o2++9hM1Fl11dvNzOkP2Yc5wwTSa9gFl IiFpyyVha9WfuR7sR4pLxkYm4mf+kozJcxJypq+fvOhZdo3mofofguG+tIX8XCpDZ3Jb 3yT1tp0Pq6l0Kq89opUhOECs3cf/LQJBcus2yR4V/Q7kUlm7E+S5PzmV4FxPIS5A9aV9 WzfFzVzbWChy0itm96J1FTdKlIyKJbsMcerbQclbXHsClipiukMLcnvJR0ISszrrmy49 KdMQ== X-Forwarded-Encrypted: i=1; AL+hErGDHzupfjYInw4XxRRwSgZxRAuexE41JMb2YEn//8Z4r13Nzf8vdZ6FOB7knmgrdQ5pDA2u@lists.linux.dev X-Gm-Message-State: APuU4Z+oyM2Yw4m6DwBHuAnlvysMS3zMqYBTjOrNbPyuEI1spvds7PCk Qp6K2aHuFbkBxLhE05V+Xld5lyg35FIVF2cwa6Sk3xWXVc/Kw1yN8iS6UTiH49gnvOtXb0HaLra jMEXtLHFQSw== 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: llvm@lists.linux.dev 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