mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Zev Weiss <zev@bewilderbeest.net>
Cc: Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, Joel Stanley <joel@jms.id.au>,
	linux-kernel@vger.kernel.org, Thomas Zajic <zlatko@gmx.at>,
	stable@vger.kernel.org
Subject: Re: [PATCH] hwmon: nct6775: Fix incorrect variable reuse in fan_div calculation
Date: Wed, 25 Oct 2023 12:53:43 -0700	[thread overview]
Message-ID: <c186bb4b-9249-449e-8095-ff2b367731c5@roeck-us.net> (raw)
In-Reply-To: <20230929200822.964-2-zev@bewilderbeest.net>

On Fri, Sep 29, 2023 at 01:08:23PM -0700, Zev Weiss wrote:
> In the regmap conversion in commit 4ef2774511dc ("hwmon: (nct6775)
> Convert register access to regmap API") I reused the 'reg' variable
> for all three register reads in the fan speed calculation loop in
> nct6775_update_device(), but failed to notice that the value from the
> first one (data->REG_FAN[i]) is actually used in the call to
> nct6775_select_fan_div() at the end of the loop body.  Since that
> patch the register value passed to nct6775_select_fan_div() has been
> (conditionally) incorrectly clobbered with the value of a different
> register than intended, which has in at least some cases resulted in
> fan speeds being adjusted down to zero.
> 
> Fix this by using dedicated temporaries for the two intermediate
> register reads instead of 'reg'.
> 
> Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
> Fixes: 4ef2774511dc ("hwmon: (nct6775) Convert register access to regmap API")
> Reported-by: Thomas Zajic <zlatko@gmx.at>
> Tested-by: Thomas Zajic <zlatko@gmx.at>
> Cc: stable@vger.kernel.org # v5.19+

Applied.

Thanks,
Guenter

      reply	other threads:[~2023-10-25 19:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29 20:08 Zev Weiss
2023-10-25 19:53 ` 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=c186bb4b-9249-449e-8095-ff2b367731c5@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=jdelvare@suse.com \
    --cc=joel@jms.id.au \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=zev@bewilderbeest.net \
    --cc=zlatko@gmx.at \
    /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®