Skip to content

Commit 71ea448

Browse files
kmaincentjfvogel
authored andcommitted
net: pse-pd: pd692x0: Fix power limit retrieval
[ Upstream commit f6093c5 ] 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 3e9dbfe ("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: a87e699 ("net: pse-pd: pd692x0: Enhance with new current limit and voltage read callbacks") Signed-off-by: Kory Maincent <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit a055b1bc4009cfdf5b160a321f9638f880c89ce6) Signed-off-by: Jack Vogel <[email protected]>
1 parent 645edc2 commit 71ea448

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/pse-pd/pd692x0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ static int pd692x0_pi_get_pw_limit(struct pse_controller_dev *pcdev,
10121012
if (ret < 0)
10131013
return ret;
10141014

1015-
return pd692x0_pi_get_pw_from_table(buf.data[2], buf.data[3]);
1015+
return pd692x0_pi_get_pw_from_table(buf.data[0], buf.data[1]);
10161016
}
10171017

10181018
static int pd692x0_pi_set_pw_limit(struct pse_controller_dev *pcdev,

0 commit comments

Comments
 (0)