]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: pse-pd: pd692x0: Fix power limit retrieval
authorKory Maincent <kory.maincent@bootlin.com>
Mon, 17 Feb 2025 13:48:11 +0000 (14:48 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Feb 2025 12:30:17 +0000 (04:30 -0800)
commita055b1bc4009cfdf5b160a321f9638f880c89ce6
treedfd29ad1fa02de50685c4762222bd0c7f710e3c8
parent9a2e2b058162e0e87b960a59d52ce4299e92a74b
net: pse-pd: pd692x0: Fix power limit retrieval

[ Upstream commit f6093c5ec74d5cc495f89bd359253d9c738d04d9 ]

Fix incorrect data offset read in the pd692x0_pi_get_pw_limit callback.
The issue was previously unnoticed as it was only used by the regulator
API and not thoroughly tested, since the PSE is mainly controlled via
ethtool.

The function became actively used by ethtool after commit 3e9dbfec4998
("net: pse-pd: Split ethtool_get_status into multiple callbacks"),
which led to the discovery of this issue.

Fix it by using the correct data offset.

Fixes: a87e699c9d33 ("net: pse-pd: pd692x0: Enhance with new current limit and voltage read callbacks")
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20250217134812.1925345-1-kory.maincent@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/pse-pd/pd692x0.c