Skip to content

Commit 6a3a09c

Browse files
mikeystewartsmith
authored andcommitted
libflash: Fix pflash -i
pflash -i is currently broken due to this commit commit 602dee4 Author: Cyril Bur <[email protected]> libflash/libffs: Rework libffs It's output doesn't correctly detect the last partition and continues printing forever. This fixes it by returning null when we don't find a partition in ffs_get_part(). Signed-off-by: Michael Neuling <[email protected]> Acked-by: Cyril Bur <[email protected]> Signed-off-by: Stewart Smith <[email protected]>
1 parent 461d410 commit 6a3a09c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libflash/libffs.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,10 @@ static struct ffs_entry *ffs_get_part(struct ffs_handle *ffs, uint32_t index)
187187

188188
list_for_each(&ffs->hdr.entries, ent, list)
189189
if (i++ == index)
190-
break;
190+
return ent;
191191

192-
return ent;
192+
/* Didn't find partition */
193+
return NULL;
193194
}
194195

195196
bool has_ecc(struct ffs_entry *ent)

0 commit comments

Comments
 (0)