net/mlx5: fix buffer allocation check in rule cleanup
authorViacheslav Ovsiienko <viacheslavo@mellanox.com>
Sat, 10 Nov 2018 09:59:25 +0000 (09:59 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 13 Nov 2018 23:35:53 +0000 (00:35 +0100)
commit00ae11c4e876e05988c7ed87bfb12d7113bb7900
treec8b92db86036d25be4d5f8895bc9f5a3d252e4d3
parent0c9df53de400e187238fb0b2cf379c1739ed78ac
net/mlx5: fix buffer allocation check in rule cleanup

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>
drivers/net/mlx5/mlx5_flow_tcf.c