]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
zns: remove unnecessary label, fix wrong goto
authorSteven Seungcheol Lee <sc108.lee@samsung.com>
Thu, 9 Dec 2021 08:01:31 +0000 (17:01 +0900)
committerSteven Seungcheol Lee <sc108.lee@samsung.com>
Thu, 9 Dec 2021 13:22:00 +0000 (22:22 +0900)
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
plugins/zns/zns.c

index 04b8a20881856ea62ec0b13e7c265c03664d13d6..17283110703a4cf842ad42ef94f9594243916961 100644 (file)
@@ -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);