From: Steven Seungcheol Lee Date: Thu, 9 Dec 2021 08:01:31 +0000 (+0900) Subject: zns: remove unnecessary label, fix wrong goto X-Git-Tag: v2.0-rc0~33^2~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=bf715e99d60a716ccc65bbe9e5ac61fa43875529;p=users%2Fsagi%2Fnvme-cli.git zns: remove unnecessary label, fix wrong goto Signed-off-by: Steven Seungcheol Lee --- 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);