Skip to content

Commit

Permalink
net/af_packet: handle possible null pointer
Browse files Browse the repository at this point in the history
Fixes: 1b93c2a ("net/af_packet: add interface name to internals")
Cc: stable@dpdk.org

Signed-off-by: Chas Williams <ciwillia@brocade.com>
  • Loading branch information
Chas Williams authored and Ferruh Yigit committed Jun 12, 2017
1 parent f28ede5 commit 92656e9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/af_packet/rte_eth_af_packet.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 92656e9

Please sign in to comment.