From: YOSHIFUJI Hideaki Date: Mon, 21 Nov 2005 10:07:25 +0000 (+0900) Subject: [PATCH] Fix memory management error during setting up new advapi sockopts. X-Git-Tag: v2.6.14.3~8 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0527c1095dbf42535c9dbffc12e8c41f59d46f86;p=karo-tx-linux.git [PATCH] Fix memory management error during setting up new advapi sockopts. Signed-off-by: YOSHIFUJI Hideaki Signed-off-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index 922549581abc..748577b76d75 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c @@ -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); }