From: Sinan Kaya <ok...@kernel.org>

In rte_pmd_tun_probe result of call to rte_vdev_device_name is
dereferenced here and may be null.

Signed-off-by: Sinan Kaya <ok...@kernel.org>
---
 drivers/net/tap/rte_eth_tap.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index f2a6c33a19..aa640f8acc 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -2340,6 +2340,10 @@ rte_pmd_tun_probe(struct rte_vdev_device *dev)
        struct rte_eth_dev *eth_dev;
 
        name = rte_vdev_device_name(dev);
+       if (!name) {
+               return -1;
+       }
+
        params = rte_vdev_device_args(dev);
        memset(remote_iface, 0, RTE_ETH_NAME_MAX_LEN);
 
-- 
2.25.1

Reply via email to