diff options
-rw-r--r-- | libflash/libffs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libflash/libffs.c b/libflash/libffs.c index 9ce7224..dca4018 100644 --- a/libflash/libffs.c +++ b/libflash/libffs.c @@ -187,9 +187,10 @@ static struct ffs_entry *ffs_get_part(struct ffs_handle *ffs, uint32_t index) list_for_each(&ffs->hdr.entries, ent, list) if (i++ == index) - break; + return ent; - return ent; + /* Didn't find partition */ + return NULL; } bool has_ecc(struct ffs_entry *ent) |