[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>
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c
index db098ff..cb530ee 100644
--- a/net/core/dev_mcast.c
+++ b/net/core/dev_mcast.c
@@ -194,8 +194,7 @@
done:
spin_unlock_bh(&dev->xmit_lock);
- if (dmi1)
- kfree(dmi1);
+ kfree(dmi1);
return err;
}
diff --git a/net/core/sock.c b/net/core/sock.c
index 9602ceb..13cc3be 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1242,8 +1242,7 @@
static void sock_def_destruct(struct sock *sk)
{
- if (sk->sk_protinfo)
- kfree(sk->sk_protinfo);
+ kfree(sk->sk_protinfo);
}
void sk_send_sigurg(struct sock *sk)