vhost: fix memory leak
authorYong Wang <wang.yong19@zte.com.cn>
Wed, 4 Jan 2017 03:57:55 +0000 (22:57 -0500)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Tue, 17 Jan 2017 08:20:17 +0000 (09:20 +0100)
commit5731d6acc7fe1f76ed895d08821b51dd5c817bd0
treeee8e802b366e20854d5ad9b851a8554cd1d537dd
parent9edfedf5e45e3e35c13438c73c9903d07c8237c9
vhost: fix memory leak

In function vhost_new_device(), current code dose not free 'dev'
in "i == MAX_VHOST_DEVICE" condition statements. It will lead to a
memory leak.

Fixes: 45ca9c6f7bc6 ("vhost: get rid of linked list for devices")
Cc: stable@dpdk.org
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/vhost.c