net: thunderx: set xdp_prog to NULL if bpf_prog_add fails
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Wed, 21 Nov 2018 15:32:10 +0000 (16:32 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Nov 2018 19:40:30 +0000 (11:40 -0800)
commit6d0f60b0f8588fd4380ea5df9601e12fddd55ce2
tree333aeb0e376635b4c54c57b70908191e8a287af6
parent0211dda68a4f6531923a2f72d8e8959207f59fba
net: thunderx: set xdp_prog to NULL if bpf_prog_add fails

Set xdp_prog pointer to NULL if bpf_prog_add fails since that routine
reports the error code instead of NULL in case of failure and xdp_prog
pointer value is used in the driver to verify if XDP is currently
enabled.
Moreover report the error code to userspace if nicvf_xdp_setup fails

Fixes: 05c773f52b96 ("net: thunderx: Add basic XDP support")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/thunder/nicvf_main.c