All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: Wim Van Sebroeck <wim@linux-watchdog.org>,
	Guenter Roeck <linux@roeck-us.net>
Cc: Nathan Chancellor <nathan@kernel.org>,
	linux-watchdog@vger.kernel.org, llvm@lists.linux.dev,
	 linux-kernel@vger.kernel.org, Ian Rogers <irogers@google.com>,
	 Neil Armstrong <neil.armstrong@linaro.org>,
	Kevin Hilman <khilman@baylibre.com>,
	 Jerome Brunet <jbrunet@baylibre.com>,
	 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-arm-kernel@lists.infradead.org,
	 linux-amlogic@lists.infradead.org
Subject: [PATCH 5/5] watchdog: meson_gxbb_wdt: Set .owner = THIS_MODULE in watchdog_ops
Date: Mon, 30 Nov 2026 14:54:09 -0800	[thread overview]
Message-ID: <20261130225410.98349-6-irogers@google.com> (raw)
In-Reply-To: <20261130225410.98349-1-irogers@google.com>

watchdog_open() calls try_module_get(wdd->ops->owner) to prevent the
watchdog driver module from being unloaded while /dev/watchdog is open,
and watchdog_release() calls module_put(wdd->ops->owner). Because
try_module_get(NULL) succeeds without incrementing any module reference
count, omitting .owner = THIS_MODULE allows the module to be unloaded
while the watchdog character device is open.

Set .owner = THIS_MODULE in meson_gxbb_wdt_ops, found with Clang's
require_explicit_initialization attribute.

Fixes: 683fa50f0e18 ("watchdog: Add Meson GXBB Watchdog Driver")
Signed-off-by: Ian Rogers <irogers@google.com>
---
 drivers/watchdog/meson_gxbb_wdt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/watchdog/meson_gxbb_wdt.c b/drivers/watchdog/meson_gxbb_wdt.c
index a88fe8cbeef5..7ee8632eba36 100644
--- a/drivers/watchdog/meson_gxbb_wdt.c
+++ b/drivers/watchdog/meson_gxbb_wdt.c
@@ -108,6 +108,7 @@ static unsigned int meson_gxbb_wdt_get_timeleft(struct watchdog_device *wdt_dev)
 }
 
 static const struct watchdog_ops meson_gxbb_wdt_ops = {
+	.owner = THIS_MODULE,
 	.start = meson_gxbb_wdt_start,
 	.stop = meson_gxbb_wdt_stop,
 	.ping = meson_gxbb_wdt_ping,
-- 
2.56.1.839.g22a8290db9-goog


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

WARNING: multiple messages have this Message-ID (diff)
From: Ian Rogers <irogers@google.com>
To: Wim Van Sebroeck <wim@linux-watchdog.org>,
	Guenter Roeck <linux@roeck-us.net>
Cc: Nathan Chancellor <nathan@kernel.org>,
	linux-watchdog@vger.kernel.org, llvm@lists.linux.dev,
	 linux-kernel@vger.kernel.org, Ian Rogers <irogers@google.com>,
	 Neil Armstrong <neil.armstrong@linaro.org>,
	Kevin Hilman <khilman@baylibre.com>,
	 Jerome Brunet <jbrunet@baylibre.com>,
	 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-arm-kernel@lists.infradead.org,
	 linux-amlogic@lists.infradead.org
Subject: [PATCH 5/5] watchdog: meson_gxbb_wdt: Set .owner = THIS_MODULE in watchdog_ops
Date: Mon, 30 Nov 2026 14:54:09 -0800	[thread overview]
Message-ID: <20261130225410.98349-6-irogers@google.com> (raw)
In-Reply-To: <20261130225410.98349-1-irogers@google.com>

watchdog_open() calls try_module_get(wdd->ops->owner) to prevent the
watchdog driver module from being unloaded while /dev/watchdog is open,
and watchdog_release() calls module_put(wdd->ops->owner). Because
try_module_get(NULL) succeeds without incrementing any module reference
count, omitting .owner = THIS_MODULE allows the module to be unloaded
while the watchdog character device is open.

Set .owner = THIS_MODULE in meson_gxbb_wdt_ops, found with Clang's
require_explicit_initialization attribute.

Fixes: 683fa50f0e18 ("watchdog: Add Meson GXBB Watchdog Driver")
Signed-off-by: Ian Rogers <irogers@google.com>
---
 drivers/watchdog/meson_gxbb_wdt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/watchdog/meson_gxbb_wdt.c b/drivers/watchdog/meson_gxbb_wdt.c
index a88fe8cbeef5..7ee8632eba36 100644
--- a/drivers/watchdog/meson_gxbb_wdt.c
+++ b/drivers/watchdog/meson_gxbb_wdt.c
@@ -108,6 +108,7 @@ static unsigned int meson_gxbb_wdt_get_timeleft(struct watchdog_device *wdt_dev)
 }
 
 static const struct watchdog_ops meson_gxbb_wdt_ops = {
+	.owner = THIS_MODULE,
 	.start = meson_gxbb_wdt_start,
 	.stop = meson_gxbb_wdt_stop,
 	.ping = meson_gxbb_wdt_ping,
-- 
2.56.1.839.g22a8290db9-goog



  parent reply	other threads:[~2026-11-30 22:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 22:54 [PATCH 0/5] watchdog: Set missing .owner = THIS_MODULE in watchdog_ops Ian Rogers
2026-11-30 22:54 ` [PATCH 1/5] watchdog: arm_smc_wdt: Set " Ian Rogers
2026-11-30 22:57   ` sashiko-bot
2026-11-30 22:54 ` [PATCH 2/5] watchdog: bd96801_wdt: " Ian Rogers
2026-12-01  8:03   ` Matti Vaittinen
2026-12-01 16:19     ` Guenter Roeck
2026-12-01 17:19       ` Ian Rogers
2026-12-01 17:43         ` Matti Vaittinen
2026-12-01 18:02           ` Ian Rogers
2026-12-01 19:44             ` Guenter Roeck
2026-12-02  6:28             ` Matti Vaittinen
2026-12-01 19:24           ` Guenter Roeck
2026-12-02  6:38             ` Matti Vaittinen
2026-12-02  7:28               ` Guenter Roeck
2026-11-30 22:54 ` [PATCH 3/5] watchdog: ebc-c384_wdt: " Ian Rogers
2026-11-30 22:54 ` [PATCH 4/5] watchdog: max77620: " Ian Rogers
2026-11-30 22:54 ` Ian Rogers [this message]
2026-11-30 22:54   ` [PATCH 5/5] watchdog: meson_gxbb_wdt: " Ian Rogers
2026-11-30 23:10 ` [PATCH 0/5] watchdog: Set missing " Guenter Roeck

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=20261130225410.98349-6-irogers@google.com \
    --to=irogers@google.com \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=llvm@lists.linux.dev \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=nathan@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=wim@linux-watchdog.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.