From 5c1ab098694b13d752296eab64decac3b51829dd Mon Sep 17 00:00:00 2001 From: Keith Busch Date: Thu, 26 Sep 2019 02:26:12 +0900 Subject: [PATCH] Report invalid output format for 'list' command Don't fail silently if user provdies invalid 'list' options. Reported-by: Christoph Hellwig Signed-off-by: Keith Busch --- nvme.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nvme.c b/nvme.c index 43000f1..7bf2a50 100644 --- a/nvme.c +++ b/nvme.c @@ -1399,8 +1399,10 @@ static int list(int argc, char **argv, struct command *cmd, struct plugin *plugi return ret; fmt = validate_output_format(cfg.output_format); - if (fmt != JSON && fmt != NORMAL) + if (fmt != JSON && fmt != NORMAL) { + fprintf(stderr, "Invalid output format\n"); return -EINVAL; + } ret = scan_subsystems(&t); if (ret) { -- 2.50.1