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 <ciwillia@brocade.com>
This commit is contained in:
parent
f28ede500c
commit
92656e96dd
@ -630,6 +630,8 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
|
|||||||
goto error_early;
|
goto error_early;
|
||||||
}
|
}
|
||||||
(*internals)->if_name = strdup(pair->value);
|
(*internals)->if_name = strdup(pair->value);
|
||||||
|
if ((*internals)->if_name == NULL)
|
||||||
|
goto error_early;
|
||||||
(*internals)->if_index = ifr.ifr_ifindex;
|
(*internals)->if_index = ifr.ifr_ifindex;
|
||||||
|
|
||||||
if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) == -1) {
|
if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) == -1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user