Commit 84cfc97f authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

nvme: fix allocation in test_nvme_qpair_destroy



act_tr is supposed to be allocated with the system allocator
(malloc/calloc) rather than nvme_malloc.

Additionally, the size was incorrect - act_tr is an array of pointers,
not a single struct nvme_tracker.

Change-Id: I2c66b4891d11d0a8a32e3740c27fcfb42b1db2d7
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 25f0056e
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -287,10 +287,8 @@ void test_nvme_qpair_process_completions(void)
void test_nvme_qpair_destroy(void)
{
	struct nvme_qpair	qpair = {0};
	struct nvme_request	*req = NULL;
	struct nvme_controller	ctrlr = {};
	struct nvme_registers	regs = {0};
	struct nvme_tracker	*tr_temp;
	uint64_t		phys_addr = 0;

	memset(&ctrlr, 0, sizeof(ctrlr));
@@ -302,8 +300,7 @@ void test_nvme_qpair_destroy(void)
	qpair.cpl = nvme_malloc("nvme_completion", sizeof(struct nvme_completion),
				64, &phys_addr);

	qpair.act_tr = nvme_malloc("nvme_tracker", sizeof(struct nvme_tracker),
				   64, &phys_addr);
	qpair.act_tr = calloc(32, sizeof(struct nvme_tracker *));

	nvme_qpair_destroy(&qpair);
}