Check for errors returned by dev_add_bb_dev() and bail if there are any. Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx> --- lib/bootstrap/devfs.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/bootstrap/devfs.c b/lib/bootstrap/devfs.c index 576f151..48b74f9 100644 --- a/lib/bootstrap/devfs.c +++ b/lib/bootstrap/devfs.c @@ -94,7 +94,14 @@ void* bootstrap_read_devfs(char *devname, bool use_bb, int offset, } if (use_bb) { - dev_add_bb_dev(partname, "bbx"); + ret = dev_add_bb_dev(partname, "bbx"); + if (ret) { + bootstrap_err( + "%s: failed to add bad block aware partition (%d)\n", + devname, ret); + goto exit; + } + partname = "bbx"; } @@ -131,6 +138,6 @@ free_memory: free(header); if (!result) free(to); - +exit: return result; } -- 2.1.4 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox