virtio: move allocation before initialization
authorStephen Hemminger <stephen@networkplumber.org>
Mon, 9 Feb 2015 01:14:01 +0000 (09:14 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 20 Feb 2015 18:18:57 +0000 (19:18 +0100)
commitfb9d1704964574ac3d3ea68669320974a6407007
treecab9ec83c2c6d6329a56d5152b392dbd6171b479
parente3d61d1609cb9b3ea851c7776bfbb60dcfe8844a
virtio: move allocation before initialization

If allocation fails, don't want to leave virtio device stuck
in middle of initialization sequence.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
lib/librte_pmd_virtio/virtio_ethdev.c