[Skiboot] [PATCH] core/flash: Fix passing pointer instead of value

Cyril Bur cyril.bur at au1.ibm.com
Wed Jul 27 18:19:11 AEST 2016


flash_find_subpartition() accepts a pointer to a boolean variable
indicating ecc for a region of flash and passes the pointer directly
to flash_read_corrected() which actually only wants the value. This
has always worked probably because there has always been ECC on
sub partitions.

How there aren't any warnings triggered by this condition escapes me.

Fixes: 6c26bc7 ("libflash: move ffs_flash_read into libflash")
Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
---
 core/flash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/flash.c b/core/flash.c
index d3bda65..e9c1f7d 100644
--- a/core/flash.c
+++ b/core/flash.c
@@ -455,7 +455,7 @@ static int flash_find_subpartition(struct blocklevel_device *bl, uint32_t subid,
 
 	/* Get the TOC */
 	rc = flash_read_corrected(bl, *start, header,
-			FLASH_SUBPART_HEADER_SIZE, ecc);
+			FLASH_SUBPART_HEADER_SIZE, *ecc);
 	if (rc) {
 		prerror("FLASH: flash subpartition TOC read failed %i\n", rc);
 		goto end;
-- 
2.9.0



More information about the Skiboot mailing list