diff options
Diffstat (limited to 'net/ipv6/exthdrs.c')
-rw-r--r-- | net/ipv6/exthdrs.c | 3 |
1 files changed, 2 insertions, 1 deletions
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, | |||
628 | if (!tot_len) | 628 | if (!tot_len) |
629 | return NULL; | 629 | return NULL; |
630 | 630 | ||
631 | tot_len += sizeof(*opt2); | ||
631 | opt2 = sock_kmalloc(sk, tot_len, GFP_ATOMIC); | 632 | opt2 = sock_kmalloc(sk, tot_len, GFP_ATOMIC); |
632 | if (!opt2) | 633 | if (!opt2) |
633 | return ERR_PTR(-ENOBUFS); | 634 | return ERR_PTR(-ENOBUFS); |
@@ -668,7 +669,7 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, | |||
668 | 669 | ||
669 | return opt2; | 670 | return opt2; |
670 | out: | 671 | out: |
671 | sock_kfree_s(sk, p, tot_len); | 672 | sock_kfree_s(sk, opt2, opt2->tot_len); |
672 | return ERR_PTR(err); | 673 | return ERR_PTR(err); |
673 | } | 674 | } |
674 | 675 | ||