summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormsaitoh <msaitoh@NetBSD.org>2010-03-11 04:55:04 +0000
committermsaitoh <msaitoh@NetBSD.org>2010-03-11 04:55:04 +0000
commitff15f2a4f87a6820f3fe3b7384cddb3a91e2d730 (patch)
tree87ec400ad9fc5aa025e49b5f271d99472760be04 /sys/dev
parentebc9e23316b54d5b46df49c20eb3fd9ee99e1506 (diff)
Add missing ifmedia_delete_instance() in bnx_detach().
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_bnx.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c
index 1c4938e0ca9..18230665a22 100644
--- a/sys/dev/pci/if_bnx.c
+++ b/sys/dev/pci/if_bnx.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bnx.c,v 1.31 2010/01/19 22:07:00 pooka Exp $ */
+/* $NetBSD: if_bnx.c,v 1.32 2010/03/11 04:55:04 msaitoh Exp $ */
/* $OpenBSD: if_bnx.c,v 1.85 2009/11/09 14:32:41 dlg Exp $ */
/*-
@@ -35,7 +35,7 @@
#if 0
__FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $");
#endif
-__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.31 2010/01/19 22:07:00 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.32 2010/03/11 04:55:04 msaitoh Exp $");
/*
* The following controllers are supported by this driver:
@@ -785,6 +785,10 @@ bnx_detach(device_t dev, int flags)
pmf_device_deregister(dev);
callout_destroy(&sc->bnx_timeout);
ether_ifdetach(ifp);
+
+ /* Delete all remaining media. */
+ ifmedia_delete_instance(&sc->bnx_mii.mii_media, IFM_INST_ANY);
+
if_detach(ifp);
mii_detach(&sc->bnx_mii, MII_PHY_ANY, MII_OFFSET_ANY);