From 8c9b9ab60b571d1d4584ee368308ceef5e876a7b Mon Sep 17 00:00:00 2001 From: Andreas Hindborg Date: Thu, 16 Sep 2021 05:30:37 +0000 Subject: [PATCH] Fix dead assignment 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 --- plugins/zns/zns.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/zns/zns.c b/plugins/zns/zns.c index 9562d364..2091f07b 100644 --- a/plugins/zns/zns.c +++ b/plugins/zns/zns.c @@ -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); } -- 2.50.1