From: sashiko-bot@kernel.org
To: "Mark Pearson" <mpearson-lenovo@squebb.ca>
Cc: linux-watchdog@vger.kernel.org
Subject: Re: [PATCH v2] watchdog: lenovo_se30g2_se60_wdt: Watchdog for Lenovo SE30G2 and SE60
Date: Thu, 25 Jun 2026 17:52:34 +0000 [thread overview]
Message-ID: <20260625175235.49B101F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260625174328.3339996-1-mpearson-lenovo@squebb.ca>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Incorrect error cleanup for a registered platform device leaves a zombified sysfs device.
--
commit 728400a02a11a5d2e004ae6d02e2731670483271
Author: Mark Pearson <mpearson-lenovo@squebb.ca>
watchdog: lenovo_se30g2_se60_wdt: Watchdog for Lenovo SE30G2 and SE60
This commit adds the watchdog driver implementation for Lenovo SE30G2 and
SE60 platforms.
> diff --git a/drivers/watchdog/lenovo_se30g2_se60_wdt.c b/drivers/watchdog/lenovo_se30g2_se60_wdt.c
> --- /dev/null
> +++ b/drivers/watchdog/lenovo_se30g2_se60_wdt.c
[ ... ]
> +static int se_30g2_60_create_device(const struct dmi_system_id *id)
> +{
> + int err;
> +
> + se_30g2_60_pdev = platform_device_alloc("lenovo-se30g2-se60-wdt", -1);
> + if (!se_30g2_60_pdev)
> + return -ENOMEM;
> +
> + err = platform_device_add(se_30g2_60_pdev);
> + if (err) {
> + platform_device_put(se_30g2_60_pdev);
> + se_30g2_60_pdev = NULL;
> + }
> +
> + return err;
> +}
[ ... ]
> +static int __init se_30g2_60_wdt_init(void)
> +{
> + int err;
> +
> + if (!dmi_check_system(se_30g2_60))
> + return -ENODEV;
> +
> + err = platform_driver_register(&se_30g2_60_wdt_driver);
> + if (err && se_30g2_60_pdev) {
> + platform_device_put(se_30g2_60_pdev);
[Severity: Medium]
Since the device was successfully added to the system bus via
platform_device_add() in the DMI callback earlier, will calling
platform_device_put() here just drop the allocation reference without
removing the device from the sysfs hierarchy?
Should this error path use platform_device_unregister() instead to avoid
leaving a zombie device on the bus that could cause collisions on a later
module load?
> + se_30g2_60_pdev = NULL;
> + }
> +
> + return err;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260625174328.3339996-1-mpearson-lenovo@squebb.ca?part=1
prev parent reply other threads:[~2026-06-25 17:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-25 17:43 [PATCH v2] watchdog: lenovo_se30g2_se60_wdt: Watchdog for Lenovo SE30G2 and SE60 Mark Pearson
2026-06-25 17:52 ` sashiko-bot [this message]
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=20260625175235.49B101F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=mpearson-lenovo@squebb.ca \
--cc=sashiko-reviews@lists.linux.dev \
/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