[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c186bb4b-9249-449e-8095-ff2b367731c5@roeck-us.net>
Date: Wed, 25 Oct 2023 12:53:43 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Zev Weiss <zev@...ilderbeest.net>
Cc: Jean Delvare <jdelvare@...e.com>, linux-hwmon@...r.kernel.org,
Joel Stanley <joel@....id.au>, linux-kernel@...r.kernel.org,
Thomas Zajic <zlatko@....at>, stable@...r.kernel.org
Subject: Re: [PATCH] hwmon: nct6775: Fix incorrect variable reuse in fan_div
calculation
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@...ilderbeest.net>
> Fixes: 4ef2774511dc ("hwmon: (nct6775) Convert register access to regmap API")
> Reported-by: Thomas Zajic <zlatko@....at>
> Tested-by: Thomas Zajic <zlatko@....at>
> Cc: stable@...r.kernel.org # v5.19+
Applied.
Thanks,
Guenter
Powered by blists - more mailing lists