From: Chas Williams Date: Wed, 17 May 2017 18:03:33 +0000 (-0400) Subject: net/af_packet: handle possible null pointer X-Git-Tag: spdx-start~3147 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=92656e96dda5ce01d16fc751149c2763f315e6e5;p=dpdk.git 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 --- 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) {