Skip to content

Commit ae67f7d

Browse files
shemmingerdavid-marchand
authored andcommitted
examples/vhost: fix free function mismatch
The pointer bdev is allocated with rte_zmalloc() and then incorrectly freed with free() which will lead to pool corruption. Bugzilla ID: 1553 Fixes: c19beb3 ("examples/vhost_blk: introduce vhost storage sample") Cc: [email protected] Signed-off-by: Stephen Hemminger <[email protected]> Acked-by: Chengwen Feng <[email protected]> Reviewed-by: Chenbo Xia <[email protected]> Acked-by: Morten Brørup <[email protected]> Acked-by: Konstantin Ananyev <[email protected]> Acked-by: Wathsala Vithanage <[email protected]>
1 parent d891a59 commit ae67f7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/vhost_blk/vhost_blk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ vhost_blk_bdev_construct(const char *bdev_name,
776776
bdev->data = rte_zmalloc(NULL, blk_cnt * blk_size, 0);
777777
if (!bdev->data) {
778778
fprintf(stderr, "No enough reserved huge memory for disk\n");
779-
free(bdev);
779+
rte_free(bdev);
780780
return NULL;
781781
}
782782

0 commit comments

Comments
 (0)