eal: fix hotplug add and remove
authorQi Zhang <qi.z.zhang@intel.com>
Thu, 12 Jul 2018 14:01:41 +0000 (22:01 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 20 Jul 2018 12:26:16 +0000 (14:26 +0200)
commit196e9a486cb1a0fd929a15244e7d9169ef5ede00
tree8f0bbe5d3b5fbdfae418477b2d53044d68f35a48
parent084ca5728420f6afd6f617b8c7a88a4feb79053e
eal: fix hotplug add and remove

If hotplug add an already plugged PCI device, it will
cause rte_pci_device->device.name be corrupted due to unexpected
rte_devargs_remove. Also if try to hotplug remove an already
unplugged device, it will cause segment fault due to unexpected
bus->unplug on a rte_device whose driver is NULL.
The patch fix these issues.

Fixes: 7e8b26650146 ("eal: fix hotplug add / remove")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
lib/librte_eal/common/eal_common_dev.c