]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Return all errors on list command
authorKeith Busch <keith.busch@intel.com>
Mon, 10 Oct 2016 18:06:38 +0000 (12:06 -0600)
committerKeith Busch <keith.busch@intel.com>
Mon, 10 Oct 2016 18:06:38 +0000 (12:06 -0600)
Negative errors mean the command failed and we shouldn't try displaying
information if getting it wasn't succcessful.

Signed-off-by: Keith Busch <keith.busch@intel.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index 6cb46f07ac6266ab9fe18af43312a412be5c86de..a238b2efed48be181552553a87b364b694d44146 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -776,12 +776,12 @@ static int get_nvme_info(int fd, struct list_item *item, const char *node)
        int err;
 
        err = nvme_identify_ctrl(fd, &item->ctrl);
-       if (err > 0)
+       if (err)
                return err;
        item->nsid = nvme_get_nsid(fd);
        err = nvme_identify_ns(fd, item->nsid,
                               0, &item->ns);
-       if (err > 0)
+       if (err)
                return err;
        strcpy(item->node, node);
        item->block = S_ISBLK(nvme_stat.st_mode);