Skip to contentSkip to conversation

arch/i386/kernel/efi.c: fixing uninitialised variable

PATCH In review thompsy 2 participants 3 messages May 27, 2007 – May 28, 2007

Subsystems (2)
lore
Share & tools
lore

thompsy

author
#0 lore raw

PATCH 1/1 arch/i386/kernel/efi.c: fixing uninitialised variable

Hello All,

I'm going to try and work through some of the gcc warnings generated from building the kernel. I've included my first patch below but have a question first.

Having looking in MAINTAINERS I wasn't sure who the appropriate person would be to CC this to. The closest thing I could find was FIRMWARE LOADER header which is listed as an orphan. In this case should I just CC to LKML?

The patch initialises the prev struct as it gets checked before being initialised later in the code. This removes the warning generated by gcc.

Any feedback welcome.
Thanks

---

arch/i386/kernel/efi.c +1 -1
index a180802..8a9faeb 100644
@@ -278,7 +278,7 @@ void efi_memmap_walk(efi_freemem_callbac
 	struct range {
 		unsigned long start;
 		unsigned long end;
-	} prev, curr;
+	} prev={}, curr;
 	efi_memory_desc_t *md;
 	unsigned long start, end;
 	void *p;

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

#1 lore raw

thompsy <[email protected]> wrote:
[arch/i386/kernel/efi.c:efi_memmap_walk() uninitialized access]

Quoted 2 lines

The patch initialises the prev struct as it gets checked before being initialised later in the code. This removes the warning generated by gcc.

Please provide a description where/when uninitialized access occurs. I looked at the code and couldn't find any.

Florian
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

#2 lore raw
In reply to thompsy
Quoted 6 lines · Florian Westphal

thompsy <[email protected]> wrote:
[arch/i386/kernel/efi.c:efi_memmap_walk() uninitialized access]

Quoted 2 lines

The patch initialises the prev struct as it gets checked before being initialised later in the code. This removes the warning generated by gcc.

Quoted 9 lines

Please provide a description where/when uninitialized access occurs. I looked at the code and couldn't find any.

Florian
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

I just looked again and noticed my mistake. I missed the initialisation from curr, d'oh. I'll try to be more careful next time.

Thanks for looking
--
Andrew Thompson
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors