mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Guangshuo Li <lgs201920130244@gmail.com>
Cc: Rudolf Marek <r.marek@assembler.cz>,
	Sven Anders <anders@anduras.de>,
	Jean Delvare <khali@linux-fr.org>,
	Hans de Goede <hansg@kernel.org>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] hwmon: (w83793) release probe data through kref
Date: Mon, 14 Sep 2026 08:31:23 -0700	[thread overview]
Message-ID: <49f5d298-e250-4d18-b99c-aebbfe0ef458@roeck-us.net> (raw)
In-Reply-To: <20260914073638.1662500-1-lgs201920130244@gmail.com>

On Mon, Sep 14, 2026 at 03:36:38PM +0800, Guangshuo Li wrote:
> w83793_probe() initializes data->kref to manage the lifetime of the
> driver data. The normal remove path drops the driver-owned reference
> with kref_put(), while watchdog users take and release additional
> references through the same kref.
> 
> However, the probe error path still frees data directly with kfree().
> This bypasses the kref-managed lifetime and discards the initial
> reference without a matching kref_put(), leaving the reference
> accounting unbalanced.
> 
> Drop the probe-owned reference with kref_put() instead and let
> w83793_release_resources() perform the final free, matching the normal
> remove path.
> 
> This issue was found by manual code inspection.
> 
> Fixes: 5852f9609d21 ("hwmon: (w83793) Add watchdog functionality")
> Cc: stable@vger.kernel.org
> Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>

Applied.

Thanks,
Guenter

      reply	other threads:[~2026-09-14 15:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14  7:36 Guangshuo Li
2026-09-14 15:31 ` Guenter Roeck [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=49f5d298-e250-4d18-b99c-aebbfe0ef458@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=anders@anduras.de \
    --cc=hansg@kernel.org \
    --cc=khali@linux-fr.org \
    --cc=lgs201920130244@gmail.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=r.marek@assembler.cz \
    --cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®