Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Dec 2012 08:44:59 +0000 (UTC)
From:      Monthadar Al Jaberi <monthadar@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244389 - head/sys/dev/wtap
Message-ID:  <201212180844.qBI8ixdX097633@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: monthadar
Date: Tue Dec 18 08:44:59 2012
New Revision: 244389
URL: http://svnweb.freebsd.org/changeset/base/244389

Log:
  wtap should check if ieee80211_vap_setup fails.
  
  * If ieee80211_vap_setup fails, we free allocated M_80211_VAP
    memory and return NULL;
  
  Approved by: adrian (mentor)

Modified:
  head/sys/dev/wtap/if_wtap.c

Modified: head/sys/dev/wtap/if_wtap.c
==============================================================================
--- head/sys/dev/wtap/if_wtap.c	Tue Dec 18 08:41:23 2012	(r244388)
+++ head/sys/dev/wtap/if_wtap.c	Tue Dec 18 08:44:59 2012	(r244389)
@@ -334,6 +334,10 @@ wtap_vap_create(struct ieee80211com *ic,
 	vap = (struct ieee80211vap *) avp;
 	error = ieee80211_vap_setup(ic, vap, name, unit, IEEE80211_M_MBSS,
 	    flags | IEEE80211_CLONE_NOBEACONS, bssid, mac);
+	if (error) {
+		free((struct wtap_vap*) vap, M_80211_VAP);
+		return NULL;
+	}
 
 	/* override various methods */
 	avp->av_recv_mgmt = vap->iv_recv_mgmt;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212180844.qBI8ixdX097633>