svn commit: r252401 - head/sys/dev/usb/wlan

Rui Paulo rpaulo at FreeBSD.org
Sun Jun 30 05:10:33 UTC 2013


Author: rpaulo
Date: Sun Jun 30 05:10:33 2013
New Revision: 252401
URL: http://svnweb.freebsd.org/changeset/base/252401

Log:
  Fix a reference count bug in urtwn_ra_init().

Modified:
  head/sys/dev/usb/wlan/if_urtwn.c

Modified: head/sys/dev/usb/wlan/if_urtwn.c
==============================================================================
--- head/sys/dev/usb/wlan/if_urtwn.c	Sun Jun 30 01:20:59 2013	(r252400)
+++ head/sys/dev/usb/wlan/if_urtwn.c	Sun Jun 30 05:10:33 2013	(r252401)
@@ -1253,6 +1253,7 @@ urtwn_ra_init(struct urtwn_softc *sc)
 	cmd.mask = htole32(mode << 28 | basicrates);
 	error = urtwn_fw_cmd(sc, R92C_CMD_MACID_CONFIG, &cmd, sizeof(cmd));
 	if (error != 0) {
+		ieee80211_free_node(ni);
 		device_printf(sc->sc_dev,
 		    "could not add broadcast station\n");
 		return (error);
@@ -1267,6 +1268,7 @@ urtwn_ra_init(struct urtwn_softc *sc)
 	cmd.mask = htole32(mode << 28 | rates);
 	error = urtwn_fw_cmd(sc, R92C_CMD_MACID_CONFIG, &cmd, sizeof(cmd));
 	if (error != 0) {
+		ieee80211_free_node(ni);
 		device_printf(sc->sc_dev, "could not add BSS station\n");
 		return (error);
 	}
@@ -1277,6 +1279,8 @@ urtwn_ra_init(struct urtwn_softc *sc)
 
 	/* Indicate highest supported rate. */
 	ni->ni_txrate = rs->rs_nrates - 1;
+	ieee80211_free_node(ni);
+
 	return (0);
 }
 


More information about the svn-src-all mailing list