From b77fcef1a5947290203a02de5982cdee68bd370a Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Sun, 26 Jun 2016 21:17:54 +0200 Subject: [PATCH] PPP, L2TP: remove unnecessary l2tp->udp null check l2tp->udp can't be null here, pppol2tp_create returns a NULL L2TP PCB if UDP PCB failed to be created. Remove useless null check. --- src/netif/ppp/pppol2tp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/netif/ppp/pppol2tp.c b/src/netif/ppp/pppol2tp.c index c364603e..8e433bb5 100644 --- a/src/netif/ppp/pppol2tp.c +++ b/src/netif/ppp/pppol2tp.c @@ -246,9 +246,7 @@ static err_t pppol2tp_destroy(ppp_pcb *ppp, void *ctx) { LWIP_UNUSED_ARG(ppp); sys_untimeout(pppol2tp_timeout, l2tp); - if (l2tp->udp != NULL) { - udp_remove(l2tp->udp); - } + udp_remove(l2tp->udp); LWIP_MEMPOOL_FREE(PPPOL2TP_PCB, l2tp); return ERR_OK; }