[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1578032749-18197-1-git-send-email-lirongqing@baidu.com>
Date: Fri, 3 Jan 2020 14:25:49 +0800
From: Li RongQing <lirongqing@...du.com>
To: netdev@...r.kernel.org, bpf@...r.kernel.org
Subject: [PATCH][bpf-next] bpf: return EOPNOTSUPP when invalid map type in __bpf_tx_xdp_map
a negative value -EOPNOTSUPP should be returned if map->map_type
is invalid although that seems unlikely now, then the caller will
continue to handle buffer, or else the buffer will be leaked
Signed-off-by: Li RongQing <lirongqing@...du.com>
---
net/core/filter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 1cbac34a4e11..40fa5905321c 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3512,7 +3512,7 @@ static int __bpf_tx_xdp_map(struct net_device *dev_rx, void *fwd,
case BPF_MAP_TYPE_XSKMAP:
return __xsk_map_redirect(fwd, xdp);
default:
- break;
+ return -EOPNOTSUPP;
}
return 0;
}
--
2.16.2
Powered by blists - more mailing lists