]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Fix dead assignment
authorAndreas Hindborg <andreas.hindborg@wdc.com>
Thu, 16 Sep 2021 05:30:37 +0000 (05:30 +0000)
committerKeith Busch <kbusch@kernel.org>
Wed, 6 Oct 2021 11:05:50 +0000 (05:05 -0600)
This patch fixes a bug in the error handling in `zns_mgmt_send`, where error
cause was not reported correctly.

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

index 9562d3642c034e8eb330b4c249754cc16113b6d7..2091f07be5be9f82b18518409b5748a164ce7185 100644 (file)
@@ -261,7 +261,7 @@ static int zns_mgmt_send(int argc, char **argv, struct command *cmd, struct plug
 
        err = fd = parse_and_open(argc, argv, desc, opts);
        if (fd < 0)
-               return errno;
+               goto ret;
 
        err = asprintf(&command, "%s-%s", plugin->name, cmd->name);
        if (err < 0)
@@ -289,6 +289,7 @@ free:
        free(command);
 close_fd:
        close(fd);
+ret:
        return nvme_status_to_errno(err, false);
 }