Date: Mon, 21 Mar 2016 22:14:48 +0000 (UTC) From: Andriy Voskoboinyk <avos@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297169 - head/sys/dev/usb/wlan Message-ID: <201603212214.u2LMEm7l045176@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603212214.u2LMEm7l045176>