Skip to contentSkip to conversation

libfdt: Correct condition for reordering blocks

PATCH Applied Simon Glass 2 participants 2 messages Jun 15, 2020 – Jun 16, 2020 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libfdt: Correct condition for reordering blocks

This condition uses bitwise OR but should be logical OR. Fix it.

---

 libfdt/fdt_rw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libfdt/fdt_rw.c +1 -1
index 524b520..93e4a2b 100644
@@ -436,7 +436,7 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize)
 			return struct_size;
 	}
 
-	if (can_assume(LIBFDT_ORDER) |
+	if (can_assume(LIBFDT_ORDER) ||
 	    !fdt_blocks_misordered_(fdt, mem_rsv_size, struct_size)) {
 		/* no further work necessary */
 		err = fdt_move(fdt, buf, bufsize);
Signature · 1 line
2.27.0.290.gba653c62da-goog

A message that is not in the archive (sent off-list or not yet received): 20200615160033.87328-1-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org

Applied
#2 lore raw
Quoted 4 lines · Simon Glass

This condition uses bitwise OR but should be logical OR. Fix it.

Applied, thanks.

Quoted 18 lines

---

 libfdt/fdt_rw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libfdt/fdt_rw.c +1 -1
index 524b520..93e4a2b 100644
@@ -436,7 +436,7 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize)
 			return struct_size;
 	}
 
-	if (can_assume(LIBFDT_ORDER) |
+	if (can_assume(LIBFDT_ORDER) ||
 	    !fdt_blocks_misordered_(fdt, mem_rsv_size, struct_size)) {
 		/* no further work necessary */
 		err = fdt_move(fdt, buf, bufsize);
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