[PPP]: remove redundant NULL pointer checks before kfree & vfree
authorJesper Juhl <juhl-lkml@dif.dk>
Tue, 3 May 2005 21:38:09 +0000 (14:38 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 May 2005 21:38:09 +0000 (14:38 -0700)
kfree() and vfree() can both deal with NULL pointers. This patch removes
redundant NULL pointer checks from the ppp code in drivers/net/

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ppp_deflate.c
drivers/net/ppp_generic.c

index 507d6328d4eb00743c4b04a91586812f83b357b3..3872088fdd10cc4dafb1c37bfaea89736d671d6c 100644 (file)
@@ -87,8 +87,7 @@ static void z_comp_free(void *arg)
 
        if (state) {
                zlib_deflateEnd(&state->strm);
-               if (state->strm.workspace)
-                       vfree(state->strm.workspace);
+               vfree(state->strm.workspace);
                kfree(state);
        }
 }
@@ -308,8 +307,7 @@ static void z_decomp_free(void *arg)
 
        if (state) {
                zlib_inflateEnd(&state->strm);
-               if (state->strm.workspace)
-                       kfree(state->strm.workspace);
+               kfree(state->strm.workspace);
                kfree(state);
        }
 }
index c456dc81b8730f694ed9f22d54a48bddc2c2bf39..3b377f6cd4a0bff915d75d46cef3d66eb16cbf20 100644 (file)
@@ -2467,14 +2467,10 @@ static void ppp_destroy_interface(struct ppp *ppp)
        skb_queue_purge(&ppp->mrq);
 #endif /* CONFIG_PPP_MULTILINK */
 #ifdef CONFIG_PPP_FILTER
-       if (ppp->pass_filter) {
-               kfree(ppp->pass_filter);
-               ppp->pass_filter = NULL;
-       }
-       if (ppp->active_filter) {
-               kfree(ppp->active_filter);
-               ppp->active_filter = NULL;
-       }
+       kfree(ppp->pass_filter);
+       ppp->pass_filter = NULL;
+       kfree(ppp->active_filter);
+       ppp->active_filter = NULL;
 #endif /* CONFIG_PPP_FILTER */
 
        kfree(ppp);