bus/vdev: fix hotplug twice
authorRaslan Darawsheh <rasland@mellanox.com>
Thu, 21 Feb 2019 19:01:25 +0000 (20:01 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 5 Mar 2019 12:32:31 +0000 (12:32 +0000)
commite892fa595e19b5cce315045444b3b7e31130ef19
treefa3dd05329bdd08b2a19383fcf38bb251f89d34b
parent4169ed6ed1c31b75f070cdccf3ee82561d4b79ce
bus/vdev: fix hotplug twice

In case vdev was already probed, it shouldn't be probed again,
and it should return -EEXIST as error.
There are some checks in vdev_probe() and insert_vdev(),
but a check was missing in vdev_plug().
The check is moved in vdev_probe_all_drivers() which is called
in all code paths.

Fixes: e9d159c3d534 ("eal: allow probing a device again")
Cc: stable@dpdk.org
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
drivers/bus/vdev/vdev.c