mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ppc64: fix prom.c compile warning
@ 2005-05-06  3:29 Paul Mackerras
  0 siblings, 0 replies; only message in thread
From: Paul Mackerras @ 2005-05-06  3:29 UTC (permalink / raw)
  To: akpm, torvalds; +Cc: apw, anton, linux-kernel

The code in unflatten_device_tree knows that get_property is written to
only return with lenp equal to 1 when also returning a valid pointer.
The gcc 3.3.3 compiler is not able to prove this to itself, so it warns
about a possible uninitialized pointer dereference:

 .../arch/ppc64/kernel/prom.c: In function `unflatten_device_tree':
 .../arch/ppc64/kernel/prom.c:828:
 warning: `p' might be used uninitialized in this function

Unless it is desired to rework the interaction between the two
functions, this will keep the existing behavior but quiet the compiler.

Signed-off-by: Amos Waterland <apw@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
---
diff -urN linux-2.6/arch/ppc64/kernel/prom.c test/arch/ppc64/kernel/prom.c
--- linux-2.6/arch/ppc64/kernel/prom.c	2005-05-02 08:29:36.000000000 +1000
+++ test/arch/ppc64/kernel/prom.c	2005-05-06 13:27:29.000000000 +1000
@@ -834,7 +834,7 @@
 {
 	unsigned long start, mem, size;
 	struct device_node **allnextp = &allnodes;
-	char *p;
+	char *p = NULL;
 	int l = 0;
 
 	DBG(" -> unflatten_device_tree()\n");

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-05-06  4:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-06  3:29 [PATCH] ppc64: fix prom.c compile warning Paul Mackerras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®