]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-cli/intel: Return if arg parsing returns error
authorKeith Busch <keith.busch@intel.com>
Thu, 7 Dec 2017 18:03:39 +0000 (11:03 -0700)
committerKeith Busch <keith.busch@intel.com>
Thu, 7 Dec 2017 18:03:39 +0000 (11:03 -0700)
Signed-off-by: Keith Busch <keith.busch@intel.com>
intel-nvme.c

index 375b7a374ff159c9e472620f001d664577af10a7..bbd1313c5b8d832d08ec10c5f0d7f639631a607c 100644 (file)
@@ -680,6 +680,8 @@ static int get_internal_log(int argc, char **argv, struct command *command, stru
        };
 
        fd = parse_and_open(argc, argv, desc, command_line_options, &cfg, sizeof(cfg));
+       if (fd < 0)
+               return fd;
        if (cfg.log > 2 || cfg.core > 4 || cfg.lnum > 255) {
                free(intel);
                return EINVAL;