Skip to content

Commit 4abbe66

Browse files
kmaincentgregkh
authored andcommitted
net: pse-pd: Fix deadlock in current limit functions
commit 488fb6e upstream. Fix a deadlock in pse_pi_get_current_limit and pse_pi_set_current_limit caused by consecutive mutex_lock calls. One in the function itself and another in pse_pi_get_voltage. Resolve the issue by using the unlocked version of pse_pi_get_voltage instead. Fixes: e0a5e2b ("net: pse-pd: Use power limit at driver side instead of current limit") Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> Link: https://patch.msgid.link/20250212151751.1515008-1-kory.maincent@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 384c829 commit 4abbe66

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/pse-pd/pse_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ static int pse_pi_get_current_limit(struct regulator_dev *rdev)
309309
goto out;
310310
mW = ret;
311311

312-
ret = pse_pi_get_voltage(rdev);
312+
ret = _pse_pi_get_voltage(rdev);
313313
if (!ret) {
314314
dev_err(pcdev->dev, "Voltage null\n");
315315
ret = -ERANGE;
@@ -346,7 +346,7 @@ static int pse_pi_set_current_limit(struct regulator_dev *rdev, int min_uA,
346346

347347
id = rdev_get_id(rdev);
348348
mutex_lock(&pcdev->lock);
349-
ret = pse_pi_get_voltage(rdev);
349+
ret = _pse_pi_get_voltage(rdev);
350350
if (!ret) {
351351
dev_err(pcdev->dev, "Voltage null\n");
352352
ret = -ERANGE;

0 commit comments

Comments
 (0)