提交 8b8aa4b5 编写于 作者: Y YOSHIFUJI Hideaki

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

Signed-off-by: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
上级 741b2252
...@@ -628,6 +628,7 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, ...@@ -628,6 +628,7 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt,
if (!tot_len) if (!tot_len)
return NULL; return NULL;
tot_len += sizeof(*opt2);
opt2 = sock_kmalloc(sk, tot_len, GFP_ATOMIC); opt2 = sock_kmalloc(sk, tot_len, GFP_ATOMIC);
if (!opt2) if (!opt2)
return ERR_PTR(-ENOBUFS); return ERR_PTR(-ENOBUFS);
...@@ -668,7 +669,7 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, ...@@ -668,7 +669,7 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt,
return opt2; return opt2;
out: out:
sock_kfree_s(sk, p, tot_len); sock_kfree_s(sk, opt2, opt2->tot_len);
return ERR_PTR(err); return ERR_PTR(err);
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册