test/accel&rdma: Fix unittest_accel and unittest_nvme_rdma failure

There are errors occur that uninitialised value created by a stack allocation when running unittest_accel and unittest_nvme_rdma with valgrind.

Change-Id: I4b48b472cc7c189cbcaf8ca772830a23118e7e17
Signed-off-by: Jaylyn Ren <jaylyn.ren@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10559
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Jaylyn Ren 2021-11-16 18:00:02 +08:00 committed by Jim Harris
parent a33d4af6b1
commit 3e937f07eb
2 changed files with 3 additions and 3 deletions

View File

@ -1357,7 +1357,7 @@ nvme_rdma_get_memory_translation(struct nvme_request *req, struct nvme_rdma_qpai
struct nvme_rdma_memory_translation_ctx *_ctx)
{
struct spdk_memory_domain_translation_ctx ctx;
struct spdk_memory_domain_translation_result dma_translation;
struct spdk_memory_domain_translation_result dma_translation = {.iov_count = 0};
struct spdk_rdma_memory_translation rdma_translation;
int rc;

View File

@ -216,8 +216,8 @@ static void
test_spdk_accel_submit_copy(void)
{
const uint64_t nbytes = TEST_SUBMIT_SIZE;
uint8_t dst[TEST_SUBMIT_SIZE];
uint8_t src[TEST_SUBMIT_SIZE];
uint8_t dst[TEST_SUBMIT_SIZE] = {0};
uint8_t src[TEST_SUBMIT_SIZE] = {0};
void *cb_arg = NULL;
int rc;
struct spdk_accel_task task;