From c373e1d6adbc3785e8f1072cdc4a062733baa514 Mon Sep 17 00:00:00 2001 From: Zhenlei Huang Date: Sun, 23 Apr 2023 12:47:57 +0800 Subject: [PATCH] if_stf: Delete unreachable code As the flag M_WAITOK is passed to ip_encap_attach(), then the function will never return NULL, and the following code within NULL check branch will be unreachable. No functional change intended. Reviewed by: kp Fixes: 6d8fdfa9d5e7d Rework IP encapsulation handling code MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39746 --- sys/net/if_stf.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index afc7b446fca7..5cb9a9d5c6dc 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -295,12 +295,6 @@ stf_clone_create(struct if_clone *ifc, char *name, size_t len, ifp->if_dunit = IF_DUNIT_NONE; sc->encap_cookie = ip_encap_attach(&ipv4_encap_cfg, sc, M_WAITOK); - if (sc->encap_cookie == NULL) { - if_printf(ifp, "attach failed\n"); - free(sc, M_STF); - ifc_free_unit(ifc, unit); - return (ENOMEM); - } ifp->if_mtu = IPV6_MMTU; ifp->if_ioctl = stf_ioctl;