Skip to content

Commit 98cadde

Browse files
jonasjelonekrobimarko
authored andcommitted
generic: backport pse-pd error check fix
Backport a patch fixing the error return check when loading PSE PIs from the DT tree in case the pairset property isn't specified. This patch might be backported upstream in stable. Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> Link: openwrt#23449 Signed-off-by: Robert Marko <robimarko@gmail.com>
1 parent fb7c14c commit 98cadde

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From 33d35975cbead3fa6b738ee57e5e45e14fbe0886 Mon Sep 17 00:00:00 2001
2+
From: Jonas Jelonek <jelonek.jonas@gmail.com>
3+
Date: Fri, 15 May 2026 14:31:03 +0000
4+
Subject: [PATCH] net: pse-pd: fix sign on -ENOENT check in of_load_pse_pis()
5+
6+
of_count_phandle_with_args() returns the count on success and a negative
7+
errno on failure, including -ENOENT when the "pairsets" property is
8+
absent. The existing comparison in of_load_pse_pis() checks against
9+
ENOENT (positive 2) instead of -ENOENT, so the branch is taken for any
10+
error return: legitimate DTs that omit "pairsets" trigger a spurious
11+
"wrong number of pairsets" error and probe fails with -EINVAL.
12+
13+
Compare against -ENOENT so a missing "pairsets" property is correctly
14+
treated as "this PI has no pairsets, continue".
15+
16+
Fixes: 9be9567a7c59 ("net: pse-pd: Add support for PSE PIs")
17+
Cc: stable@vger.kernel.org
18+
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
19+
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
20+
Link: https://patch.msgid.link/20260515143103.1721888-1-jelonek.jonas@gmail.com
21+
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
22+
23+
--- a/drivers/net/pse-pd/pse_core.c
24+
+++ b/drivers/net/pse-pd/pse_core.c
25+
@@ -210,7 +210,7 @@ static int of_load_pse_pis(struct pse_co
26+
ret = of_load_pse_pi_pairsets(node, &pi, ret);
27+
if (ret)
28+
goto out;
29+
- } else if (ret != ENOENT) {
30+
+ } else if (ret != -ENOENT) {
31+
dev_err(pcdev->dev,
32+
"error: wrong number of pairsets. Should be 1 or 2, got %d (%pOF)\n",
33+
ret, node);

0 commit comments

Comments
 (0)