]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Fix error handling in `list-ctrl`
authorAndreas Hindborg <andreas.hindborg@wdc.com>
Wed, 15 Sep 2021 14:20:44 +0000 (14:20 +0000)
committerKeith Busch <kbusch@kernel.org>
Mon, 20 Sep 2021 16:17:47 +0000 (10:17 -0600)
This patch fixes a bug in `list-ctrl` where an error code was misinterpreted.

Signed-off-by: Andreas Hindborg <andreas.hindborg@wdc.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index 6e56d900a5094026dc53f9231a3457d24b2e0e3e..e5b6d3bbea5a3f2e7c924503bbecbf98214e9055 100644 (file)
--- 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);