summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeiwei Hu <jlu.hpw@foxmail.com>2021-11-19 17:12:18 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-01-27 08:46:15 +0100
commit1f3f0862696768cbea146d29f96c5f3fdc1348ee (patch)
tree4d8d4dd8e1750a4a5fb880e08960f610b4b174fe
parentc3e4e1d1d4c06d11b1429a07e46804ac03073828 (diff)
powerpc/prom_init: Fix improper check of prom_getprop()
[ Upstream commit 869fb7e5aecbc163003f93f36dcc26d0554319f6 ] prom_getprop() can return PROM_ERROR. Binary operator can not identify it. Fixes: 94d2dde738a5 ("[POWERPC] Efika: prune fixups and make them more carefull") Signed-off-by: Peiwei Hu <jlu.hpw@foxmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/tencent_BA28CC6897B7C95A92EB8C580B5D18589105@qq.com Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--arch/powerpc/kernel/prom_init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 3139533640fc..204e44cc896e 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -2526,7 +2526,7 @@ static void __init fixup_device_tree_efika_add_phy(void)
/* Check if the phy-handle property exists - bail if it does */
rv = prom_getprop(node, "phy-handle", prop, sizeof(prop));
- if (!rv)
+ if (rv <= 0)
return;
/*