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

Commit 8b8aa4b5 authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki
Browse files

[IPV6]: Fix memory management error during setting up new advapi sockopts.

parent 741b2252
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -628,6 +628,7 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt,
	if (!tot_len)
		return NULL;

	tot_len += sizeof(*opt2);
	opt2 = sock_kmalloc(sk, tot_len, GFP_ATOMIC);
	if (!opt2)
		return ERR_PTR(-ENOBUFS);
@@ -668,7 +669,7 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt,

	return opt2;
out:
	sock_kfree_s(sk, p, tot_len);
	sock_kfree_s(sk, opt2, opt2->tot_len);
	return ERR_PTR(err);
}