The pointer bdev is allocated with rte_zmalloc() and then
incorrectly freed with free() which will lead pool corruption.

Bugzilla ID: 1553
Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample")
Cc: jin...@intel.com
Cc: sta...@dpdk.org

Signed-off-by: Stephen Hemminger <step...@networkplumber.org>
---
 examples/vhost_blk/vhost_blk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/vhost_blk/vhost_blk.c b/examples/vhost_blk/vhost_blk.c
index 03f1ac9c3f..9c9e326949 100644
--- a/examples/vhost_blk/vhost_blk.c
+++ b/examples/vhost_blk/vhost_blk.c
@@ -776,7 +776,7 @@ vhost_blk_bdev_construct(const char *bdev_name,
        bdev->data = rte_zmalloc(NULL, blk_cnt * blk_size, 0);
        if (!bdev->data) {
                fprintf(stderr, "No enough reserved huge memory for disk\n");
-               free(bdev);
+               rte_free(bdev);
                return NULL;
        }
 
-- 
2.45.2

Reply via email to