net/virtio_user: fix error management during init
authorJianfeng Tan <jianfeng.tan@intel.com>
Tue, 27 Sep 2016 19:11:06 +0000 (19:11 +0000)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 28 Sep 2016 00:18:39 +0000 (02:18 +0200)
commitca8326a94365a5444098d76711d4bfb59ba28b26
treea2d54f583492c1781d14066a2310da955096fc77
parent57ae79a75b8ade1ea4624789caf5dc55a3a95c98
net/virtio_user: fix error management during init

Currently, when virtio_user device fails to be started (e.g., vhost
unix socket does not exit), the init function does not return struct
rte_eth_dev (and some other structs) back to ether layer. And what's
more, it does not report the error to upper layer.

The fix is to free those structs and report error when failing to
start virtio_user devices.

Fixes: ce2eabdd43ec ("net/virtio-user: add virtual device")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
drivers/net/virtio/virtio_user_ethdev.c