[NET]: kfree cleanup

From: Jesper Juhl <jesper.juhl@gmail.com>

This is the net/ part of the big kfree cleanup patch.

Remove pointless checks for NULL prior to calling kfree() in net/.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
This commit is contained in:
Jesper Juhl
2005-11-08 09:41:34 -08:00
committed by David S. Miller
parent ac7c98eca8
commit a51482bde2
47 changed files with 99 additions and 191 deletions

View File

@@ -1099,7 +1099,7 @@ static void release_driver(struct sock *sk)
sock_reset_flag(sk, SOCK_ZAPPED);
wp = wp_sk(sk);
if (wp && wp->mbox) {
if (wp) {
kfree(wp->mbox);
wp->mbox = NULL;
}
@@ -1186,10 +1186,8 @@ static void wanpipe_kill_sock_timer (unsigned long data)
return;
}
if (wp_sk(sk)) {
kfree(wp_sk(sk));
wp_sk(sk) = NULL;
}
kfree(wp_sk(sk));
wp_sk(sk) = NULL;
if (atomic_read(&sk->sk_refcnt) != 1) {
atomic_set(&sk->sk_refcnt, 1);
@@ -1219,10 +1217,8 @@ static void wanpipe_kill_sock_accept (struct sock *sk)
sk->sk_socket = NULL;
if (wp_sk(sk)) {
kfree(wp_sk(sk));
wp_sk(sk) = NULL;
}
kfree(wp_sk(sk));
wp_sk(sk) = NULL;
if (atomic_read(&sk->sk_refcnt) != 1) {
atomic_set(&sk->sk_refcnt, 1);
@@ -1243,10 +1239,8 @@ static void wanpipe_kill_sock_irq (struct sock *sk)
sk->sk_socket = NULL;
if (wp_sk(sk)) {
kfree(wp_sk(sk));
wp_sk(sk) = NULL;
}
kfree(wp_sk(sk));
wp_sk(sk) = NULL;
if (atomic_read(&sk->sk_refcnt) != 1) {
atomic_set(&sk->sk_refcnt, 1);