The Netlink message buffer is allocated and there is the typo,
the other pointer is checked instead of returned one. If no
memory is allocated and NULL is returned by allocation routine
the bug causes segmentation fault. The patch fixes typo,
returned pointer is validated.
Fixes:
f420f03d6772 ("net/mlx5: add E-switch VXLAN rule cleanup routines")
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
vxindex = ifm->ifi_index;
cmd = flow_tcf_alloc_nlcmd(ctx, MNL_ALIGN(sizeof(struct nlmsghdr)) +
MNL_ALIGN(sizeof(struct ifinfomsg)));
- if (!nlh) {
+ if (!cmd) {
rte_errno = ENOMEM;
return -rte_errno;
}