diff options
| author | YOSHIFUJI Hideaki <[email protected]> | 2007-11-21 01:30:56 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2007-11-21 01:30:56 +0000 |
| commit | aacbe8c8800adfea42eb754396c6ebcd992cb36a (patch) | |
| tree | e158faf799c888808ddd40bfd16f4793d3522322 /net/ipv6/tcp_ipv6.c | |
| parent | [IPV4] TCPMD5: Use memmove() instead of memcpy() because we have overlaps. (diff) | |
| download | kernel-aacbe8c8800adfea42eb754396c6ebcd992cb36a.tar.gz kernel-aacbe8c8800adfea42eb754396c6ebcd992cb36a.zip | |
[IPV6] TCPMD5: Check return value of tcp_alloc_md5sig_pool().
Signed-off-by: YOSHIFUJI Hideaki <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
| -rw-r--r-- | net/ipv6/tcp_ipv6.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 3aad861975a0..b1bfbdd85d3c 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -581,7 +581,10 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer, } sk->sk_route_caps &= ~NETIF_F_GSO_MASK; } - tcp_alloc_md5sig_pool(); + if (tcp_alloc_md5sig_pool() == NULL) { + kfree(newkey); + return -ENOMEM; + } if (tp->md5sig_info->alloced6 == tp->md5sig_info->entries6) { keys = kmalloc((sizeof (tp->md5sig_info->keys6[0]) * (tp->md5sig_info->entries6 + 1)), GFP_ATOMIC); |
