em/emx: Fix attach error handling and media leakage in detach
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 23 Sep 2013 01:34:17 +0000 (09:34 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 23 Sep 2013 01:34:17 +0000 (09:34 +0800)
commitd28112277f4c399526ab70620043fa490280d797
treea68b2fca6646274d4a70429284e7f9e0a895f087
parent14374a6580a4efea3ac3b1f67038f41a635a5638
em/emx: Fix attach error handling and media leakage in detach

- Add missing ether_ifdetach() if reset fails.
Reported-by: Johannes Hofmann <Johannes.Hofmann@gmx.de>
- Call ifmedia_removeall() on detach path, since these drivers add
  ifmedia themselves; move ifmedia_init() to the beginning of attach
  for this to work.
sys/dev/netif/em/if_em.c
sys/dev/netif/emx/if_emx.c