diff options
author | Jesper Juhl <jesper.juhl@gmail.com> | 2005-11-08 12:41:34 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-11-08 12:41:34 -0500 |
commit | a51482bde22f99c63fbbb57d5d46cc666384e379 (patch) | |
tree | 5482ed1c0803edb2ffbd51035de921fb0f72d82b /net/wanrouter/af_wanpipe.c | |
parent | ac7c98eca88a854755475fcfe1b2bf5f97f90d99 (diff) |
[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>
Diffstat (limited to 'net/wanrouter/af_wanpipe.c')
-rw-r--r-- | net/wanrouter/af_wanpipe.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/net/wanrouter/af_wanpipe.c b/net/wanrouter/af_wanpipe.c index 596cb96e5f47..59fec59b2132 100644 --- a/net/wanrouter/af_wanpipe.c +++ b/net/wanrouter/af_wanpipe.c | |||
@@ -1099,7 +1099,7 @@ static void release_driver(struct sock *sk) | |||
1099 | sock_reset_flag(sk, SOCK_ZAPPED); | 1099 | sock_reset_flag(sk, SOCK_ZAPPED); |
1100 | wp = wp_sk(sk); | 1100 | wp = wp_sk(sk); |
1101 | 1101 | ||
1102 | if (wp && wp->mbox) { | 1102 | if (wp) { |
1103 | kfree(wp->mbox); | 1103 | kfree(wp->mbox); |
1104 | wp->mbox = NULL; | 1104 | wp->mbox = NULL; |
1105 | } | 1105 | } |
@@ -1186,10 +1186,8 @@ static void wanpipe_kill_sock_timer (unsigned long data) | |||
1186 | return; | 1186 | return; |
1187 | } | 1187 | } |
1188 | 1188 | ||
1189 | if (wp_sk(sk)) { | 1189 | kfree(wp_sk(sk)); |
1190 | kfree(wp_sk(sk)); | 1190 | wp_sk(sk) = NULL; |
1191 | wp_sk(sk) = NULL; | ||
1192 | } | ||
1193 | 1191 | ||
1194 | if (atomic_read(&sk->sk_refcnt) != 1) { | 1192 | if (atomic_read(&sk->sk_refcnt) != 1) { |
1195 | atomic_set(&sk->sk_refcnt, 1); | 1193 | atomic_set(&sk->sk_refcnt, 1); |
@@ -1219,10 +1217,8 @@ static void wanpipe_kill_sock_accept (struct sock *sk) | |||
1219 | sk->sk_socket = NULL; | 1217 | sk->sk_socket = NULL; |
1220 | 1218 | ||
1221 | 1219 | ||
1222 | if (wp_sk(sk)) { | 1220 | kfree(wp_sk(sk)); |
1223 | kfree(wp_sk(sk)); | 1221 | wp_sk(sk) = NULL; |
1224 | wp_sk(sk) = NULL; | ||
1225 | } | ||
1226 | 1222 | ||
1227 | if (atomic_read(&sk->sk_refcnt) != 1) { | 1223 | if (atomic_read(&sk->sk_refcnt) != 1) { |
1228 | atomic_set(&sk->sk_refcnt, 1); | 1224 | atomic_set(&sk->sk_refcnt, 1); |
@@ -1243,10 +1239,8 @@ static void wanpipe_kill_sock_irq (struct sock *sk) | |||
1243 | 1239 | ||
1244 | sk->sk_socket = NULL; | 1240 | sk->sk_socket = NULL; |
1245 | 1241 | ||
1246 | if (wp_sk(sk)) { | 1242 | kfree(wp_sk(sk)); |
1247 | kfree(wp_sk(sk)); | 1243 | wp_sk(sk) = NULL; |
1248 | wp_sk(sk) = NULL; | ||
1249 | } | ||
1250 | 1244 | ||
1251 | if (atomic_read(&sk->sk_refcnt) != 1) { | 1245 | if (atomic_read(&sk->sk_refcnt) != 1) { |
1252 | atomic_set(&sk->sk_refcnt, 1); | 1246 | atomic_set(&sk->sk_refcnt, 1); |