diff options
author | William Tu <u9012063@gmail.com> | 2017-12-21 15:51:22 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-26 17:30:11 -0500 |
commit | 214bb1c78a4dd94ba748f1707ecc70041abe1fd3 (patch) | |
tree | dd5285ea1c135f4fea1d701dd7a486ede2d25484 /net/ipv4/ip_gre.c | |
parent | fb7df5e4000a6bc19e350a00a93b16c602bd2dd8 (diff) | |
download | blackbird-op-linux-214bb1c78a4dd94ba748f1707ecc70041abe1fd3.tar.gz blackbird-op-linux-214bb1c78a4dd94ba748f1707ecc70041abe1fd3.zip |
net: erspan: remove md NULL check
The 'md' is allocated from 'tun_dst = ip_tun_rx_dst' and
since we've checked 'tun_dst', 'md' will never be NULL.
The patch removes it at both ipv4 and ipv6 erspan.
Fixes: afb4c97d90e6 ("ip6_gre: fix potential memory leak in ip6erspan_rcv")
Fixes: 50670b6ee9bc ("ip_gre: fix potential memory leak in erspan_rcv")
Cc: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_gre.c')
-rw-r--r-- | net/ipv4/ip_gre.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 78365094f56c..b61f2285816d 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -313,11 +313,6 @@ static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi, return PACKET_REJECT; md = ip_tunnel_info_opts(&tun_dst->u.tun_info); - if (!md) { - dst_release((struct dst_entry *)tun_dst); - return PACKET_REJECT; - } - memcpy(md, pkt_md, sizeof(*md)); md->version = ver; |