Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96edf83c authored by Jesper Juhl's avatar Jesper Juhl Committed by David S. Miller
Browse files

[PPP]: remove redundant NULL pointer checks before kfree & vfree



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: default avatarJesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c3924c70
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -87,7 +87,6 @@ static void z_comp_free(void *arg)


	if (state) {
	if (state) {
		zlib_deflateEnd(&state->strm);
		zlib_deflateEnd(&state->strm);
		if (state->strm.workspace)
		vfree(state->strm.workspace);
		vfree(state->strm.workspace);
		kfree(state);
		kfree(state);
	}
	}
@@ -308,7 +307,6 @@ static void z_decomp_free(void *arg)


	if (state) {
	if (state) {
		zlib_inflateEnd(&state->strm);
		zlib_inflateEnd(&state->strm);
		if (state->strm.workspace)
		kfree(state->strm.workspace);
		kfree(state->strm.workspace);
		kfree(state);
		kfree(state);
	}
	}
+4 −8
Original line number Original line Diff line number Diff line
@@ -2467,14 +2467,10 @@ static void ppp_destroy_interface(struct ppp *ppp)
	skb_queue_purge(&ppp->mrq);
	skb_queue_purge(&ppp->mrq);
#endif /* CONFIG_PPP_MULTILINK */
#endif /* CONFIG_PPP_MULTILINK */
#ifdef CONFIG_PPP_FILTER
#ifdef CONFIG_PPP_FILTER
	if (ppp->pass_filter) {
	kfree(ppp->pass_filter);
	kfree(ppp->pass_filter);
	ppp->pass_filter = NULL;
	ppp->pass_filter = NULL;
	}
	if (ppp->active_filter) {
	kfree(ppp->active_filter);
	kfree(ppp->active_filter);
	ppp->active_filter = NULL;
	ppp->active_filter = NULL;
	}
#endif /* CONFIG_PPP_FILTER */
#endif /* CONFIG_PPP_FILTER */


	kfree(ppp);
	kfree(ppp);