From b7d61ba3171971c5bfdb5e889a6150deec4fca54 Mon Sep 17 00:00:00 2001 From: Mikolaj Golub Date: Tue, 3 Jul 2012 19:04:18 +0000 Subject: [PATCH] Don't check for ifp != NULL before KASSERT, as ifp may not be NULL here (it is dereferenced below). Discussed with: jhb MFC after: 1 week --- sys/netinet/igmp.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index 4c0b105fa55..94c00a11275 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -2285,13 +2285,11 @@ igmp_change_state(struct in_multi *inm) */ KASSERT(inm->inm_ifma != NULL, ("%s: no ifma", __func__)); ifp = inm->inm_ifma->ifma_ifp; - if (ifp != NULL) { - /* - * Sanity check that netinet's notion of ifp is the - * same as net's. - */ - KASSERT(inm->inm_ifp == ifp, ("%s: bad ifp", __func__)); - } + /* + * Sanity check that netinet's notion of ifp is the + * same as net's. + */ + KASSERT(inm->inm_ifp == ifp, ("%s: bad ifp", __func__)); IGMP_LOCK();