Skip to contentSkip to conversation

libfdt: Add missing RW_CHECK_HEADER to fdt_del_node()

PATCH Applied David Gibson 2 participants 2 messages Oct 18, 2007 – Oct 22, 2007

lore
Share & tools
lore
#0 lore raw

fdt_del_node(), unlike most of the rw functions does not check the fdt's header with RW_CHECK_HEADER. However, it could make a mess of things if the conditions in RW_CHECK_HEADER aren't met. So, this patch adds the omitted check.

libfdt/fdt_rw.c +2 -0
Index: dtc/libfdt/fdt_rw.c
===================================================================
@@ -329,6 +329,8 @@
 {
 	int endoffset;
 
+	RW_CHECK_HEADER(fdt);
+
 	endoffset = _fdt_node_end_offset(fdt, nodeoffset);
 	if (endoffset < 0)
 		return endoffset;
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
Applied
#1 lore raw

So, like, the other day David Gibson mumbled:

Quoted 6 lines

fdt_del_node(), unlike most of the rw functions does not check the fdt's header with RW_CHECK_HEADER. However, it could make a mess of things if the conditions in RW_CHECK_HEADER aren't met. So, this patch adds the omitted check.

Applied.

jdl