From: Andreas Hindborg Date: Wed, 15 Sep 2021 14:20:44 +0000 (+0000) Subject: Fix error handling in `list-ctrl` X-Git-Tag: v2.0-rc0~92 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=45e49f0e875b7a202f5c288499f5d902473997d7;p=users%2Fsagi%2Fnvme-cli.git Fix error handling in `list-ctrl` This patch fixes a bug in `list-ctrl` where an error code was misinterpreted. Signed-off-by: Andreas Hindborg --- diff --git a/nvme.c b/nvme.c index 6e56d900..e5b6d3bb 100644 --- a/nvme.c +++ b/nvme.c @@ -1380,7 +1380,7 @@ static int list_ctrl(int argc, char **argv, struct command *cmd, struct plugin * err = nvme_identify_nsid_ctrl_list(fd, cfg.namespace_id, cfg.cntid, cntlist); - if (err) + if (!err) nvme_show_list_ctrl(cntlist, flags); else if (err > 0) nvme_show_status(err);