]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: pse-pd: fix sign on -ENOENT check in of_load_pse_pis()
authorJonas Jelonek <jelonek.jonas@gmail.com>
Fri, 15 May 2026 14:31:03 +0000 (14:31 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 20 May 2026 00:44:27 +0000 (17:44 -0700)
commit33d35975cbead3fa6b738ee57e5e45e14fbe0886
tree54cd4f3365e802486062d52f8a8915a399da88df
parentedc502717be153674b0b3eefb8b40734c747c138
net: pse-pd: fix sign on -ENOENT check in of_load_pse_pis()

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>
Link: https://patch.msgid.link/20260515143103.1721888-1-jelonek.jonas@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/pse-pd/pse_core.c