ipv6: fix possible mem leaks in ipv6_make_skb()
authorEric Dumazet <edumazet@google.com>
Wed, 10 Jan 2018 11:45:49 +0000 (03:45 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Jan 2018 08:45:22 +0000 (09:45 +0100)
commitd3ccc74c8998de058f40fecff71ada3dc49157b3
treedf5e79b84244f832c92f2adb4ea74da4db7ca3f0
parent705813e942332a4eb63f0cfcb3cd054b4e1d34a7
ipv6: fix possible mem leaks in ipv6_make_skb()

[ Upstream commit 862c03ee1deb7e19e0f9931682e0294ecd1fcaf9 ]

ip6_setup_cork() might return an error, while memory allocations have
been done and must be rolled back.

Fixes: 6422398c2ab0 ("ipv6: introduce ipv6_make_skb")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Vlad Yasevich <vyasevich@gmail.com>
Reported-by: Mike Maloney <maloney@google.com>
Acked-by: Mike Maloney <maloney@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv6/ip6_output.c