]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: phy: marvell-88q2xxx: Fix clamped value in mv88q2xxx_hwmon_write
authorThorsten Blum <thorsten.blum@linux.dev>
Tue, 2 Dec 2025 17:27:44 +0000 (18:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Jan 2026 11:57:23 +0000 (12:57 +0100)
commit7b9ea7aa24bd1cafa12aab519c8023048033fafc
treea2e3f353a95d27a0c69017faf808040c801e4207
parent779fa2a063d4603da4b9b5c89c326da2d0f5e253
net: phy: marvell-88q2xxx: Fix clamped value in mv88q2xxx_hwmon_write

commit c4cdf7376271bce5714c06d79ec67759b18910eb upstream.

The local variable 'val' was never clamped to -75000 or 180000 because
the return value of clamp_val() was not used. Fix this by assigning the
clamped value back to 'val', and use clamp() instead of clamp_val().

Cc: stable@vger.kernel.org
Fixes: a557a92e6881 ("net: phy: marvell-88q2xxx: add support for temperature sensor")
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Dimitri Fedrau <dima.fedrau@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20251202172743.453055-3-thorsten.blum@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/marvell-88q2xxx.c