test/nvme: Fix bug where ctrlr->nsdata is null
Caught by clang 12 and UBSAN. Signed-off-by: Ben Walker <benjamin.walker@intel.com> Change-Id: I2fbb82a9225ab0cb8616bd671f8b81987cb3d708 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8853 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Tested-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
9b420e8c00
commit
dc09422cd3
@ -71,7 +71,8 @@ test_nvme_ns_construct(void)
|
||||
{
|
||||
struct spdk_nvme_ns ns = {};
|
||||
uint32_t id = 1;
|
||||
struct spdk_nvme_ctrlr ctrlr = {};
|
||||
struct spdk_nvme_ns_data nsdata = {};
|
||||
struct spdk_nvme_ctrlr ctrlr = { .nsdata = &nsdata };
|
||||
|
||||
nvme_ns_construct(&ns, id, &ctrlr);
|
||||
CU_ASSERT(ns.id == 1);
|
||||
|
Loading…
Reference in New Issue
Block a user