bdev/nvme: Call spdk_free() to the object allocated by spdk_malloc()

This is a bug fix. free() was called to the object allocated by
spdk_malloc().

Hence

  free(): invalid pointer: 0x00002000146ece00

was printed.

This was found during multipath testing.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Icf6aa6dcdda728fef91b3acad7a1f1ee219c27af
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11710
Community-CI: Mellanox Build Bot
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Shuhei Matsumoto 2022-02-23 15:04:42 +09:00 committed by Jim Harris
parent 7594030409
commit ecdbaa2310

View File

@ -3126,7 +3126,7 @@ bdev_nvme_disable_read_ana_log_page(struct nvme_ctrlr *nvme_ctrlr)
{
struct nvme_ns *nvme_ns;
free(nvme_ctrlr->ana_log_page);
spdk_free(nvme_ctrlr->ana_log_page);
nvme_ctrlr->ana_log_page = NULL;
for (nvme_ns = nvme_ctrlr_get_first_active_ns(nvme_ctrlr);