svn commit: r301435 - head/sys/dev/bwn

Adrian Chadd adrian at FreeBSD.org
Sun Jun 5 07:56:29 UTC 2016


Author: adrian
Date: Sun Jun  5 07:56:28 2016
New Revision: 301435
URL: https://svnweb.freebsd.org/changeset/base/301435

Log:
  [bwn] Add missing firmware release calls.
  
  This trips me up whenever I'm fooling around with partially supported
  NICs that fail to fully attach or initialise - the firmware gets loaded
  and references, but something fails - and the firmware references
  aren't cleaned up.

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==============================================================================
--- head/sys/dev/bwn/if_bwn.c	Sun Jun  5 07:55:21 2016	(r301434)
+++ head/sys/dev/bwn/if_bwn.c	Sun Jun  5 07:56:28 2016	(r301435)
@@ -750,6 +750,7 @@ bwn_detach(device_t dev)
 	if (mac->mac_msi != 0)
 		pci_release_msi(dev);
 	mbufq_drain(&sc->sc_snd);
+	bwn_release_firmware(mac);
 	BWN_LOCK_DESTROY(sc);
 	return (0);
 }
@@ -1328,6 +1329,7 @@ bwn_attach_core(struct bwn_mac *mac)
 	siba_dev_down(sc->sc_dev, 0);
 fail:
 	siba_powerdown(sc->sc_dev);
+	bwn_release_firmware(mac);
 	return (error);
 }
 
@@ -3930,6 +3932,7 @@ bwn_fw_gets(struct bwn_mac *mac, enum bw
 		}
 	} else if (rev < 11) {
 		device_printf(sc->sc_dev, "no PCM for rev %d\n", rev);
+		bwn_release_firmware(mac);
 		return (EOPNOTSUPP);
 	}
 


More information about the svn-src-head mailing list