Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42175dc5 authored by Eric Dumazet's avatar Eric Dumazet Committed by Tejaswi Tanikella
Browse files

ipv6: fix possible mem leaks in ipv6_make_skb()



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

Change-Id: Icd789cb74e1950b73e3fab37773b5fe22222b0a1
Fixes: 6422398c ("ipv6: introduce ipv6_make_skb")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Vlad Yasevich <vyasevich@gmail.com>
Reported-by: default avatarMike Maloney <maloney@google.com>
Acked-by: default avatarMike Maloney <maloney@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Git-commit: 862c03ee1deb7e19e0f9931682e0294ecd1fcaf9
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


[tejaswit@codeaurora.org : resolved merge conflict ]
Signed-off-by: default avatarTejaswi Tanikella <tejaswit@codeaurora.org>
parent d9b7cd55
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1779,9 +1779,10 @@ struct sk_buff *ip6_make_skb(struct sock *sk,
	cork.base.opt = NULL;
	v6_cork.opt = NULL;
	err = ip6_setup_cork(sk, &cork, &v6_cork, hlimit, tclass, opt, rt, fl6);
	if (err)
	if (err) {
		ip6_cork_release(&cork, &v6_cork);
		return ERR_PTR(err);

	}
	if (dontfrag < 0)
		dontfrag = inet6_sk(sk)->dontfrag;