aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-01-27 11:05:42 +0100
committerDavid S. Miller <davem@davemloft.net>2020-01-27 11:05:42 +0100
commit0e6223ea903a892ba6962bdf823572e595dc8236 (patch)
tree30aa053fff7bd25d7d7c42ca91a2909e90013093
parentMerge branch 'net-allow-per-net-notifier-to-follow-netdev-into-namespace' (diff)
parentnet: socionext: fix xdp_result initialization in netsec_process_rx (diff)
downloadlinux-dev-0e6223ea903a892ba6962bdf823572e595dc8236.tar.xz
linux-dev-0e6223ea903a892ba6962bdf823572e595dc8236.zip
Merge branch 'XDP-fixes-for-socionext-driver'
Lorenzo Bianconi says: ==================== XDP fixes for socionext driver Fix possible user-after-in XDP rx path Fix rx statistics accounting if no bpf program is attached ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/socionext/netsec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c
index 495f6cfdbd91..e8224b543dfc 100644
--- a/drivers/net/ethernet/socionext/netsec.c
+++ b/drivers/net/ethernet/socionext/netsec.c
@@ -935,7 +935,6 @@ static int netsec_process_rx(struct netsec_priv *priv, int budget)
struct netsec_rx_pkt_info rx_info;
enum dma_data_direction dma_dir;
struct bpf_prog *xdp_prog;
- struct sk_buff *skb = NULL;
u16 xdp_xmit = 0;
u32 xdp_act = 0;
int done = 0;
@@ -949,7 +948,8 @@ static int netsec_process_rx(struct netsec_priv *priv, int budget)
struct netsec_de *de = dring->vaddr + (DESC_SZ * idx);
struct netsec_desc *desc = &dring->desc[idx];
struct page *page = virt_to_page(desc->addr);
- u32 xdp_result = XDP_PASS;
+ u32 xdp_result = NETSEC_XDP_PASS;
+ struct sk_buff *skb = NULL;
u16 pkt_len, desc_len;
dma_addr_t dma_handle;
struct xdp_buff xdp;