discover: Skip malformed bootdev fields
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Wed, 11 Nov 2015 05:58:59 +0000 (16:58 +1100)
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Fri, 18 Dec 2015 00:15:58 +0000 (11:15 +1100)
Fixes Coverity defect #30471

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
discover/platform-powerpc.c

index 2480b8d29129fd27da866dc02e869c248c00b8b2..7370d7dcc20a21e78dacc57e2efc8ebe7e3cdb0f 100644 (file)
@@ -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,