* [PATCH net] net: pse-pd: fix sign on -ENOENT check in of_load_pse_pis()
@ 2026-05-15 14:31 Jonas Jelonek
2026-05-19 15:02 ` Oleksij Rempel
0 siblings, 1 reply; 2+ messages in thread
From: Jonas Jelonek @ 2026-05-15 14:31 UTC (permalink / raw)
To: Oleksij Rempel, Kory Maincent, Andrew Lunn, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, Jonas Jelonek, stable
of_count_phandle_with_args() returns the count on success and a negative
errno on failure, including -ENOENT when the "pairsets" property is
absent. The existing comparison in of_load_pse_pis() checks against
ENOENT (positive 2) instead of -ENOENT, so the branch is taken for any
error return: legitimate DTs that omit "pairsets" trigger a spurious
"wrong number of pairsets" error and probe fails with -EINVAL.
Compare against -ENOENT so a missing "pairsets" property is correctly
treated as "this PI has no pairsets, continue".
Fixes: 9be9567a7c59 ("net: pse-pd: Add support for PSE PIs")
Cc: stable@vger.kernel.org
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
---
drivers/net/pse-pd/pse_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/pse-pd/pse_core.c b/drivers/net/pse-pd/pse_core.c
index 87aa4f4e9724..69dbdbde9d71 100644
--- a/drivers/net/pse-pd/pse_core.c
+++ b/drivers/net/pse-pd/pse_core.c
@@ -210,7 +210,7 @@ static int of_load_pse_pis(struct pse_controller_dev *pcdev)
ret = of_load_pse_pi_pairsets(node, &pi, ret);
if (ret)
goto out;
- } else if (ret != ENOENT) {
+ } else if (ret != -ENOENT) {
dev_err(pcdev->dev,
"error: wrong number of pairsets. Should be 1 or 2, got %d (%pOF)\n",
ret, node);
base-commit: 5db89c99566fc4728cc92e941d8e1975711e24b5
--
2.51.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: pse-pd: fix sign on -ENOENT check in of_load_pse_pis()
2026-05-15 14:31 [PATCH net] net: pse-pd: fix sign on -ENOENT check in of_load_pse_pis() Jonas Jelonek
@ 2026-05-19 15:02 ` Oleksij Rempel
0 siblings, 0 replies; 2+ messages in thread
From: Oleksij Rempel @ 2026-05-19 15:02 UTC (permalink / raw)
To: Jonas Jelonek
Cc: Kory Maincent, Andrew Lunn, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, netdev, linux-kernel, stable
On Fri, May 15, 2026 at 02:31:03PM +0000, Jonas Jelonek wrote:
> of_count_phandle_with_args() returns the count on success and a negative
> errno on failure, including -ENOENT when the "pairsets" property is
> absent. The existing comparison in of_load_pse_pis() checks against
> ENOENT (positive 2) instead of -ENOENT, so the branch is taken for any
> error return: legitimate DTs that omit "pairsets" trigger a spurious
> "wrong number of pairsets" error and probe fails with -EINVAL.
>
> Compare against -ENOENT so a missing "pairsets" property is correctly
> treated as "this PI has no pairsets, continue".
>
> Fixes: 9be9567a7c59 ("net: pse-pd: Add support for PSE PIs")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
Thank you!
Best Regards,
Oleksij
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-19 15:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15 14:31 [PATCH net] net: pse-pd: fix sign on -ENOENT check in of_load_pse_pis() Jonas Jelonek
2026-05-19 15:02 ` Oleksij Rempel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox