[PATCH 07/11] discover: Skip malformed bootdev fields

Samuel Mendoza-Jonas sam.mj at au1.ibm.com
Thu Nov 12 15:34:37 AEDT 2015


Fixes Coverity defect #30471

Signed-off-by: Samuel Mendoza-Jonas <sam.mj at au1.ibm.com>
---
 discover/platform-powerpc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c
index b1092c5..807b49a 100644
--- a/discover/platform-powerpc.c
+++ b/discover/platform-powerpc.c
@@ -438,7 +438,6 @@ static void populate_bootdev_config(struct platform_powerpc *platform,
 {
 	struct autoboot_option *opt, *new = NULL;
 	char *pos, *end, *old_dev = NULL;
-	const char delim = ' ';
 	unsigned int n_new = 0;
 	const char *val;
 	bool conflict;
@@ -469,11 +468,9 @@ static void populate_bootdev_config(struct platform_powerpc *platform,
 
 		if (read_bootdev(config, &pos, opt)) {
 			pb_log("bootdev config is in an unknown format "
-			       "(expected uuid:... or mac:...)");
+			       "(expected uuid:... or mac:...)\n");
 			talloc_free(opt);
-			if (strchr(pos, delim))
-				continue;
-			return;
+			continue;
 		}
 
 		new = talloc_realloc(config, new, struct autoboot_option,
-- 
2.6.2



More information about the Petitboot mailing list