Skip to content

Commit 054215f

Browse files
committed
test: mi: Explicitly zero args for test API invocations
We have a few places where we're passing an uninitialised pointer argument to the libnvme API in the MI tests. Add an explicit zero init for these. Fixes: #563 Reported-by: Daniel Wagner <[email protected]> Signed-off-by: Jeremy Kerr <[email protected]>
1 parent 568c5b8 commit 054215f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

test/mi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ static int test_admin_set_features_cb(struct nvme_mi_ep *ep,
996996
static void test_set_features(nvme_mi_ep_t ep)
997997
{
998998
struct nvme_set_features_args args = { 0 };
999-
struct nvme_timestamp tstamp;
999+
struct nvme_timestamp tstamp = { 0 };
10001000
nvme_mi_ctrl_t ctrl;
10011001
uint32_t res;
10021002
int rc, i;
@@ -1339,7 +1339,7 @@ static int test_admin_ns_mgmt_cb(struct nvme_mi_ep *ep,
13391339

13401340
static void test_admin_ns_mgmt_create(struct nvme_mi_ep *ep)
13411341
{
1342-
struct nvme_id_ns nsid;
1342+
struct nvme_id_ns nsid = { 0 };
13431343
nvme_mi_ctrl_t ctrl;
13441344
__u32 ns;
13451345
int rc;
@@ -1828,8 +1828,8 @@ static int test_admin_get_log_split_cb(struct nvme_mi_ep *ep,
18281828

18291829
static void test_admin_get_log_split(struct nvme_mi_ep *ep)
18301830
{
1831+
struct nvme_get_log_args args = { 0 };
18311832
unsigned char buf[4096 * 2 + 4];
1832-
struct nvme_get_log_args args;
18331833
struct log_data ldata;
18341834
nvme_mi_ctrl_t ctrl;
18351835
int rc;

0 commit comments

Comments
 (0)