summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2019-03-12 19:12:53 -0700
committerFerruh Yigit <ferruh.yigit@intel.com>2019-03-29 17:25:31 +0100
commitcc7cd517b1a26f284112a5d6e5f40d6c63584930 (patch)
tree2d09d67aebd26c26674398a7c7526d190abac47c /drivers
parentc9e37832c95f05086c38b6ad5bd2dec0a03ea881 (diff)
downloaddpdk-next-eventdev-cc7cd517b1a26f284112a5d6e5f40d6c63584930.zip
dpdk-next-eventdev-cc7cd517b1a26f284112a5d6e5f40d6c63584930.tar.gz
dpdk-next-eventdev-cc7cd517b1a26f284112a5d6e5f40d6c63584930.tar.xz
net/vdev_netvsc: fix device cast
The return value from bus->find_device is a rte_device which is not safe to cast to a rte_vdev_device structure. It doesn't really matter since only being checked for NULL but static checkers might find a bug here. Fixes: 56252de779a6 ("net/vdev_netvsc: add automatic probing") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Matan Azrad <matan@mellanox.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/vdev_netvsc/vdev_netvsc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c
index ba63fac..801f54c 100644
--- a/drivers/net/vdev_netvsc/vdev_netvsc.c
+++ b/drivers/net/vdev_netvsc/vdev_netvsc.c
@@ -808,7 +808,7 @@ vdev_netvsc_cmp_rte_device(const struct rte_device *dev1,
static void
vdev_netvsc_scan_callback(__rte_unused void *arg)
{
- struct rte_vdev_device *dev;
+ struct rte_device *dev;
struct rte_devargs *devargs;
struct rte_bus *vbus = rte_bus_find_by_name("vdev");
@@ -816,8 +816,9 @@ vdev_netvsc_scan_callback(__rte_unused void *arg)
if (!strncmp(devargs->name, VDEV_NETVSC_DRIVER_NAME,
VDEV_NETVSC_DRIVER_NAME_LEN))
return;
- dev = (struct rte_vdev_device *)vbus->find_device(NULL,
- vdev_netvsc_cmp_rte_device, VDEV_NETVSC_DRIVER_NAME);
+
+ dev = vbus->find_device(NULL, vdev_netvsc_cmp_rte_device,
+ VDEV_NETVSC_DRIVER_NAME);
if (dev)
return;
if (rte_devargs_add(RTE_DEVTYPE_VIRTUAL, VDEV_NETVSC_DRIVER_NAME))