]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit4122236ba69381a029c4b5b21be3b119011cd0fd
tree333aeb0e376635b4c54c57b70908191e8a287af6
parent80b15cb83797c7ba111924c9d978dc08d5cdeb12
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: cf7916084dec ("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