net/virtio: fix dangling pointer on failure
authorAaron Conole <aconole@redhat.com>
Mon, 15 Apr 2019 14:48:18 +0000 (10:48 -0400)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 19 Apr 2019 12:51:54 +0000 (14:51 +0200)
commit7dee8c79483e370a346d68060b0b890b273e9a46
tree9b54d4e7f49684c59a9f87476208d40879570130
parent966027b4b3a3e1059bf31ca07340914f6b8bb53a
net/virtio: fix dangling pointer on failure

When eth_virtio_dev_init() is cleaning up, it does not correctly set
the mac_addrs variable to NULL, which will lead to a double free.

Found during unit-test fixes.

Fixes: 43d18765c027 ("net/virtio: fix memory leak on failure")
Cc: stable@dpdk.org
Reported-by: Michael Santana <msantana@redhat.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
drivers/net/virtio/virtio_ethdev.c