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/ipv4/ip_sockglue.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/ipv4/ip_sockglue.c')
-rw-r--r-- | net/ipv4/ip_sockglue.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 2f0b47da5b37..4f2d87257309 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -202,8 +202,7 @@ int ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct s | |||
202 | if (ra->sk == sk) { | 202 | if (ra->sk == sk) { |
203 | if (on) { | 203 | if (on) { |
204 | write_unlock_bh(&ip_ra_lock); | 204 | write_unlock_bh(&ip_ra_lock); |
205 | if (new_ra) | 205 | kfree(new_ra); |
206 | kfree(new_ra); | ||
207 | return -EADDRINUSE; | 206 | return -EADDRINUSE; |
208 | } | 207 | } |
209 | *rap = ra->next; | 208 | *rap = ra->next; |
@@ -446,8 +445,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, | |||
446 | #endif | 445 | #endif |
447 | } | 446 | } |
448 | opt = xchg(&inet->opt, opt); | 447 | opt = xchg(&inet->opt, opt); |
449 | if (opt) | 448 | kfree(opt); |
450 | kfree(opt); | ||
451 | break; | 449 | break; |
452 | } | 450 | } |
453 | case IP_PKTINFO: | 451 | case IP_PKTINFO: |
@@ -828,10 +826,8 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, | |||
828 | 826 | ||
829 | err = ip_mc_msfilter(sk, msf, ifindex); | 827 | err = ip_mc_msfilter(sk, msf, ifindex); |
830 | mc_msf_out: | 828 | mc_msf_out: |
831 | if (msf) | 829 | kfree(msf); |
832 | kfree(msf); | 830 | kfree(gsf); |
833 | if (gsf) | ||
834 | kfree(gsf); | ||
835 | break; | 831 | break; |
836 | } | 832 | } |
837 | case IP_ROUTER_ALERT: | 833 | case IP_ROUTER_ALERT: |