linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/prom_init: fix the improper check of prom_getprop
@ 2021-11-19  9:12 Peiwei Hu
  2021-11-19  9:46 ` Andy Shevchenko
  2021-11-25  9:36 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Peiwei Hu @ 2021-11-19  9:12 UTC (permalink / raw)
  To: mpe, benh, paulus, aneesh.kumar, ardb, rafael.j.wysocki,
	masahiroy, npiggin, andriy.shevchenko, adobriyan, clg
  Cc: trivial, linuxppc-dev, linux-kernel, Peiwei Hu

prom_getprop() can return PROM_ERROR. Binary operator can not identify it.

Signed-off-by: Peiwei Hu <jlu.hpw@foxmail.com>
---
 arch/powerpc/kernel/prom_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 18b04b08b983..f845065c860e 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -2991,7 +2991,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;
 
 	/*
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-25  9:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-19  9:12 [PATCH] powerpc/prom_init: fix the improper check of prom_getprop Peiwei Hu
2021-11-19  9:46 ` Andy Shevchenko
2021-11-25  9:36 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).