From 92656e96dda5ce01d16fc751149c2763f315e6e5 Mon Sep 17 00:00:00 2001 From: Chas Williams Date: Wed, 17 May 2017 14:03:33 -0400 Subject: [PATCH] net/af_packet: handle possible null pointer Fixes: 1b93c2aa81b4 ("net/af_packet: add interface name to internals") Cc: stable@dpdk.org Signed-off-by: Chas Williams --- drivers/net/af_packet/rte_eth_af_packet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index a03966a0c4..ce4dc070d4 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -630,6 +630,8 @@ rte_pmd_init_internals(struct rte_vdev_device *dev, goto error_early; } (*internals)->if_name = strdup(pair->value); + if ((*internals)->if_name == NULL) + goto error_early; (*internals)->if_index = ifr.ifr_ifindex; if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) == -1) { -- 2.20.1