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.

Signed-off-by: Jaylyn Ren <jaylyn.ren@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10559 (master)

(charry-picked from commit 3e937f07eb)
Change-Id: I4b48b472cc7c189cbcaf8ca772830a23118e7e17
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12267
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Jaylyn Ren 2021-11-16 18:00:02 +08:00 committed by Keith Lucas
parent 8c4c66ca04
commit c006d03b05
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

@ -217,8 +217,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;