if_em.c prevents the 2nd time resuming

Taku YAMAMOTO taku at tackymt.homeip.net
Sat May 1 08:28:11 UTC 2010


Greetings,

I found a bug in if_em.c which triggers a panic when resuming from the 2nd
suspend. (sleep, wakeup, sleep and wakeup will result to a panic)

It seems it has got introduced by r206001 (head) or r206211 (stable/8).

I guess the following change mistakenly slipped into em_resume() which is
completely bogus (suppose these lines should go into em_detach()?):

@@ -769,6 +774,9 @@ 
 	struct adapter *adapter = device_get_softc(dev);
 	struct ifnet *ifp = adapter->ifp;
 
+	if (adapter->led_dev != NULL)
+		led_destroy(adapter->led_dev);
+
 	EM_CORE_LOCK(adapter);
 	em_init_locked(adapter);
 	em_init_manageability(adapter);

Should I file a PR?

Virtually yours,
-- 
-|-__   YAMAMOTO, Taku
 | __ <     <taku at tackymt.homeip.net>

      - A chicken is an egg's way of producing more eggs. -


More information about the freebsd-current mailing list