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

Andriy Voskoboinyk avos at FreeBSD.org
Mon Mar 21 22:14:49 UTC 2016


Author: avos
Date: Mon Mar 21 22:14:48 2016
New Revision: 297169
URL: https://svnweb.freebsd.org/changeset/base/297169

Log:
  rum: simplify error handling in rum_newstate().
  
  Tested with WUSB54GC, STA mode.
  
  Reviewed by:	adrian
  Differential Revision:	https://reviews.freebsd.org/D5544

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

Modified: head/sys/dev/usb/wlan/if_rum.c
==============================================================================
--- head/sys/dev/usb/wlan/if_rum.c	Mon Mar 21 21:38:35 2016	(r297168)
+++ head/sys/dev/usb/wlan/if_rum.c	Mon Mar 21 22:14:48 2016	(r297169)
@@ -819,7 +819,7 @@ rum_newstate(struct ieee80211vap *vap, e
 	const struct ieee80211_txparam *tp;
 	enum ieee80211_state ostate;
 	struct ieee80211_node *ni;
-	int ret;
+	int ret = 0;
 
 	ostate = vap->iv_state;
 	DPRINTF("%s -> %s\n",
@@ -872,6 +872,7 @@ rum_newstate(struct ieee80211vap *vap, e
 		tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)];
 		if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE)
 			rum_ratectl_start(sc, ni);
+run_fail:
 		ieee80211_free_node(ni);
 		break;
 	default:
@@ -879,13 +880,7 @@ rum_newstate(struct ieee80211vap *vap, e
 	}
 	RUM_UNLOCK(sc);
 	IEEE80211_LOCK(ic);
-	return (rvp->newstate(vap, nstate, arg));
-
-run_fail:
-	RUM_UNLOCK(sc);
-	IEEE80211_LOCK(ic);
-	ieee80211_free_node(ni);
-	return ret;
+	return (ret == 0 ? rvp->newstate(vap, nstate, arg) : ret);
 }
 
 static void


More information about the svn-src-head mailing list