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: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
25f0056e9b
commit
84cfc97fdf
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user