From: Chaitanya Kulkarni Date: Wed, 31 Mar 2021 02:03:39 +0000 (-0700) Subject: zns: for zra report zone make sure data len is set X-Git-Tag: v1.14~7 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=bd0a1671e905916e58b5a69c7c6db7516c6af67b;p=users%2Fsagi%2Fnvme-cli.git zns: for zra report zone make sure data len is set Make sure for the Zone Receive Action data length is set by the user. Signed-off-by: Chaitanya Kulkarni --- diff --git a/plugins/zns/zns.c b/plugins/zns/zns.c index 75caa5c1..7f6f52e2 100644 --- a/plugins/zns/zns.c +++ b/plugins/zns/zns.c @@ -522,6 +522,11 @@ static int zone_mgmt_recv(int argc, char **argv, struct command *cmd, struct plu } } + if (cfg.zra == NVME_ZNS_ZRA_REPORT_ZONES && !cfg.data_len) { + fprintf(stderr, "error: data len is needed for NVME_ZRA_ZONE_REPORT\n"); + err = -EINVAL; + goto close_fd; + } if (cfg.data_len) { data = calloc(1, cfg.data_len); if (!data) {