From 4c7b877a5c90bcf80d42086d246981f0686d1e27 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 9 Jul 2018 11:51:27 +0200 Subject: cmdlinepart: Allow empty string Currently when cmdlinepart_do_parse() is called with an empty partitions string then an unnamed partition with size 0 is created. This is wrong of course and instead no partition should be created. With this barebox no longer crashes while booting when all partitions are deleted on the commandline using "nand0.partitions=" Signed-off-by: Sascha Hauer --- lib/cmdlinepart.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/cmdlinepart.c b/lib/cmdlinepart.c index d7d444115f..5b9f33ca1b 100644 --- a/lib/cmdlinepart.c +++ b/lib/cmdlinepart.c @@ -101,6 +101,9 @@ int cmdlinepart_do_parse(const char *devname, const char *parts, loff_t devsize, loff_t offset = 0; int ret; + if (!parts || *parts == '\0') + return 0; + while (1) { loff_t size = 0; -- cgit v1.2.3