MFC r343682:

sys/dev/wtap: Check return value from malloc(..., M_NOWAIT) and
drop unneeded cast.
This commit is contained in:
Andriy Voskoboinyk 2019-02-06 02:35:56 +00:00
parent 67741ae5d2
commit ffb22e4bfe
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/10/; revision=343823

View File

@ -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_t mac[IEEE80211_ADDR_LEN])
ni = malloc(sizeof(struct ieee80211_node), M_80211_NODE,
M_NOWAIT|M_ZERO);
if (ni == NULL)
return (NULL);
ni->ni_txrate = 130;
return ni;