eal: fix multi-process hotplug rollback
authorDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Wed, 21 Nov 2018 19:05:07 +0000 (20:05 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 25 Nov 2018 12:15:34 +0000 (13:15 +0100)
commit5d36bf2bcd87760c5656ab09f0549eea5a3adefc
treea5989c68461703e6beaf9f98442829af9e53877d
parent047e3f9f2a4a4b73da86b707af8a32039ba1cad7
eal: fix multi-process hotplug rollback

If a device fails to attach before it's plugged,
the subsequent rollback will still try to detach it,
causing a segfault. Unplugging a device that wasn't
plugged isn't really supported, so this patch adds
an extra error check to prevent that from happening.

While here, fix this also for normal (non-rollback)
detach, which could also theoretically segfault on
non-plugged device.

Fixes: 244d5130719c ("eal: enable hotplug on multi-process")

Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
lib/librte_eal/common/hotplug_mp.c