svn commit: r343823 - in stable: 10/sys/dev/wtap 11/sys/dev/wtap 12/sys/dev/wtap

Andriy Voskoboinyk avos at FreeBSD.org
Wed Feb 6 02:35:57 UTC 2019


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/10/sys/dev/wtap/if_wtap.c
Directory Properties:
  stable/10/   (props changed)

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

Modified: stable/10/sys/dev/wtap/if_wtap.c
==============================================================================
--- stable/10/sys/dev/wtap/if_wtap.c	Wed Feb  6 02:30:14 2019	(r343822)
+++ stable/10/sys/dev/wtap/if_wtap.c	Wed Feb  6 02:35:56 2019	(r343823)
@@ -371,7 +371,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);
 }
 
 /* NB: This function is not used.
@@ -744,6 +744,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;


More information about the svn-src-stable mailing list