summaryrefslogtreecommitdiffstats
path: root/plugins/ocp/ocp-fw-activation-history.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/ocp/ocp-fw-activation-history.c')
-rw-r--r--plugins/ocp/ocp-fw-activation-history.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/ocp/ocp-fw-activation-history.c b/plugins/ocp/ocp-fw-activation-history.c
index b067346..ad96c6b 100644
--- a/plugins/ocp/ocp-fw-activation-history.c
+++ b/plugins/ocp/ocp-fw-activation-history.c
@@ -207,16 +207,18 @@ int ocp_fw_activation_history_log(int argc, char **argv, struct command *cmd,
}
if (!err) {
- const enum nvme_print_flags print_flag = validate_output_format(format);
+ enum nvme_print_flags print_flag;
+
+ err = validate_output_format(format, &print_flag);
+ if (err < 0) {
+ fprintf(stderr, "Error: Invalid output format.\n");
+ return err;
+ }
if (print_flag == JSON)
ocp_fw_activation_history_json(&fw_history);
else if (print_flag == NORMAL)
ocp_fw_activation_history_normal(&fw_history);
- else {
- fprintf(stderr, "Error: Invalid output format.\n");
- err = -EINVAL;
- }
}
return err;