summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_xl.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2006-01-18 09:42:21 +0000
committerglebius <glebius@FreeBSD.org>2006-01-18 09:42:21 +0000
commit5c7c8f29d89e1c0ae28aab09627374d3666174e6 (patch)
treed202db8c2fb26f73fbe04b97fc9a55c4dfb17961 /sys/pci/if_xl.c
parentd58866740c089e3724a5a9049ac3b78608114eec (diff)
downloadFreeBSD-src-5c7c8f29d89e1c0ae28aab09627374d3666174e6.zip
FreeBSD-src-5c7c8f29d89e1c0ae28aab09627374d3666174e6.tar.gz
Check ifp before dereferencing it in xl_detach(). xl_detach() can be called
from xl_attach(), when ifp is not defined yet. Found with: Coverity Prevent(tm)
Diffstat (limited to 'sys/pci/if_xl.c')
-rw-r--r--sys/pci/if_xl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c
index f884ac6..81a9369 100644
--- a/sys/pci/if_xl.c
+++ b/sys/pci/if_xl.c
@@ -1695,7 +1695,7 @@ xl_detach(device_t dev)
KASSERT(mtx_initialized(&sc->xl_mtx), ("xl mutex not initialized"));
#ifdef DEVICE_POLLING
- if (ifp->if_capenable & IFCAP_POLLING)
+ if (ifp && ifp->if_capenable & IFCAP_POLLING)
ether_poll_deregister(ifp);
#endif
OpenPOWER on IntegriCloud