Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 289839
b: refs/heads/master
c: 5f3d9cb
h: refs/heads/master
i:
  289837: 10c9f40
  289835: 158d11f
  289831: d970b7a
  289823: 375c621
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jan 31, 2012
1 parent 10c3893 commit e722282
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a915da9b69273815527ccb3789421cb7027b545b
refs/heads/master: 5f3d9cb2962967d9d7e03abb4a7ca275a9a3fea5
6 changes: 4 additions & 2 deletions trunk/net/ipv4/tcp_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,11 +943,11 @@ int tcp_md5_do_add(struct sock *sk, const union tcp_md5_addr *addr,
tp->md5sig_info = md5sig;
}

key = kmalloc(sizeof(*key), gfp);
key = sock_kmalloc(sk, sizeof(*key), gfp);
if (!key)
return -ENOMEM;
if (hlist_empty(&md5sig->head) && !tcp_alloc_md5sig_pool(sk)) {
kfree(key);
sock_kfree_s(sk, key, sizeof(*key));
return -ENOMEM;
}

Expand All @@ -971,6 +971,7 @@ int tcp_md5_do_del(struct sock *sk, const union tcp_md5_addr *addr, int family)
if (!key)
return -ENOENT;
hlist_del_rcu(&key->node);
atomic_sub(sizeof(*key), &sk->sk_omem_alloc);
kfree_rcu(key, rcu);
if (hlist_empty(&tp->md5sig_info->head))
tcp_free_md5sig_pool();
Expand All @@ -988,6 +989,7 @@ void tcp_clear_md5_list(struct sock *sk)
tcp_free_md5sig_pool();
hlist_for_each_entry_safe(key, pos, n, &tp->md5sig_info->head, node) {
hlist_del_rcu(&key->node);
atomic_sub(sizeof(*key), &sk->sk_omem_alloc);
kfree_rcu(key, rcu);
}
}
Expand Down

0 comments on commit e722282

Please sign in to comment.