[Skiboot] [PATCH] core/flash: More pointer vs value fixes

Cyril Bur cyril.bur at au1.ibm.com
Fri Aug 12 11:04:16 AEST 2016


It appears the inital patch was incomplete and coverity has caught
more issues. The initial patch addressed one aspect of passing
pointers instead of values, actual function prototypes needed to be
changed and callers adjusted.

Fixes coverity 134277 and 134278

Fixes: 81a538a ("core/flash: Fix passing pointer instead of value")
Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
---
 core/flash.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/core/flash.c b/core/flash.c
index da435a0..1e4ac9e 100644
--- a/core/flash.c
+++ b/core/flash.c
@@ -438,7 +438,7 @@ struct flash_hostboot_header {
 /* start and total size include ECC */
 static int flash_find_subpartition(struct blocklevel_device *bl, uint32_t subid,
 				   uint32_t *start, uint32_t *total_size,
-				   bool *ecc)
+				   bool ecc)
 {
 	struct flash_hostboot_header *header;
 	char eyecatcher[5];
@@ -456,7 +456,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;
@@ -603,7 +603,7 @@ static int flash_load_resource(enum resource_id id, uint32_t subid,
 	/* Find the sub partition if required */
 	if (subid != RESOURCE_SUBID_NONE) {
 		rc = flash_find_subpartition(flash->bl, subid, &part_start,
-					     &part_size, &ecc);
+					     &part_size, ecc);
 		if (rc)
 			goto out_free_ffs;
 	}
-- 
2.9.2



More information about the Skiboot mailing list