Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Feb 2019 02:35:57 +0000 (UTC)
From:      Andriy Voskoboinyk <avos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r343823 - in stable: 10/sys/dev/wtap 11/sys/dev/wtap 12/sys/dev/wtap
Message-ID:  <201902060235.x162Zvs1016122@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avos
Date: Wed Feb  6 02:35:56 2019
New Revision: 343823
URL: https://svnweb.freebsd.org/changeset/base/343823

Log:
  MFC r343682:
  sys/dev/wtap: Check return value from malloc(..., M_NOWAIT) and
  drop unneeded cast.

Modified:
  stable/12/sys/dev/wtap/if_wtap.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/dev/wtap/if_wtap.c
  stable/11/sys/dev/wtap/if_wtap.c
Directory Properties:
  stable/10/   (props changed)
  stable/11/   (props changed)

Modified: stable/12/sys/dev/wtap/if_wtap.c
==============================================================================
--- stable/12/sys/dev/wtap/if_wtap.c	Wed Feb  6 02:30:14 2019	(r343822)
+++ stable/12/sys/dev/wtap/if_wtap.c	Wed Feb  6 02:35:56 2019	(r343823)
@@ -372,7 +372,7 @@ wtap_vap_delete(struct ieee80211vap *vap)
 	destroy_dev(avp->av_dev);
 	callout_stop(&avp->av_swba);
 	ieee80211_vap_detach(vap);
-	free((struct wtap_vap*) vap, M_80211_VAP);
+	free(avp, M_80211_VAP);
 }
 
 static void
@@ -601,6 +601,8 @@ wtap_node_alloc(struct ieee80211vap *vap, const uint8_
 
 	ni = malloc(sizeof(struct ieee80211_node), M_80211_NODE,
 	    M_NOWAIT|M_ZERO);
+	if (ni == NULL)
+		return (NULL);
 
 	ni->ni_txrate = 130;
 	return ni;



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