diff options
| author | Kristof Provost <kp@FreeBSD.org> | 2018-10-23 23:15:44 +0000 |
|---|---|---|
| committer | Kristof Provost <kp@FreeBSD.org> | 2018-10-23 23:15:44 +0000 |
| commit | 73c9014569c0e5f9f7a70359f4cb0ad8c281bdc7 (patch) | |
| tree | d688c9f29eabb839087d921118bd40f6aa4e8707 | |
| parent | ad6f5f9ab52eeedca8cbdb325e78b33381bd0e2f (diff) | |
pf: ifp can never be NULL in pfi_ifaddr_event()
There's no point in the NULL check for ifp, because we'll already have
dereferenced it by then. Moreover, the event will always have a valid ifp.
Replace the late check with an early assertion.
CID: 1357338
Notes
svn path=/head/; revision=339674
| -rw-r--r-- | sys/netpfil/pf/pf_if.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netpfil/pf/pf_if.c b/sys/netpfil/pf/pf_if.c index cc9c2f800119..4e3689c9d855 100644 --- a/sys/netpfil/pf/pf_if.c +++ b/sys/netpfil/pf/pf_if.c @@ -904,6 +904,9 @@ pfi_detach_group_event(void *arg __unused, struct ifg_group *ifg) static void pfi_ifaddr_event(void *arg __unused, struct ifnet *ifp) { + + KASSERT(ifp, ("ifp == NULL")); + if (ifp->if_pf_kif == NULL) return; @@ -912,7 +915,7 @@ pfi_ifaddr_event(void *arg __unused, struct ifnet *ifp) return; } PF_RULES_WLOCK(); - if (ifp && ifp->if_pf_kif) { + if (ifp->if_pf_kif) { V_pfi_update++; pfi_kif_update(ifp->if_pf_kif); } |
