From bf715e99d60a716ccc65bbe9e5ac61fa43875529 Mon Sep 17 00:00:00 2001 From: Steven Seungcheol Lee Date: Thu, 9 Dec 2021 17:01:31 +0900 Subject: [PATCH] zns: remove unnecessary label, fix wrong goto Signed-off-by: Steven Seungcheol Lee --- plugins/zns/zns.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/zns/zns.c b/plugins/zns/zns.c index 04b8a208..17283110 100644 --- a/plugins/zns/zns.c +++ b/plugins/zns/zns.c @@ -928,7 +928,7 @@ static int zone_append(int argc, char **argv, struct command *cmd, struct plugin "Data size:%#"PRIx64" not aligned to lba size:%#x\n", (uint64_t)cfg.data_size, lba_size); errno = EINVAL; - goto close_ns; + goto close_fd; } meta_size = ns.lbaf[(ns.flbas & 0x0f)].ms; @@ -938,20 +938,20 @@ static int zone_append(int argc, char **argv, struct command *cmd, struct plugin "Metadata size:%#"PRIx64" not aligned to metadata size:%#x\n", (uint64_t)cfg.metadata_size, meta_size); errno = EINVAL; - goto close_ns; + goto close_fd; } if (cfg.prinfo > 0xf) { fprintf(stderr, "Invalid value for prinfo:%#x\n", cfg.prinfo); errno = EINVAL; - goto close_ns; + goto close_fd; } if (cfg.data) { dfd = open(cfg.data, O_RDONLY); if (dfd < 0) { perror(cfg.data); - goto close_ns; + goto close_fd; } } @@ -973,7 +973,7 @@ static int zone_append(int argc, char **argv, struct command *cmd, struct plugin if (mfd < 0) { perror(cfg.metadata); err = -1; - goto close_dfd; + goto free_data; } } @@ -1029,7 +1029,6 @@ free_data: close_dfd: if (cfg.data) close(dfd); -close_ns: close_fd: close(fd); return nvme_status_to_errno(err, false); -- 2.50.1