sys/dev/wtap: Check return value from malloc(..., M_NOWAIT) and

drop unneeded cast.

MFC after:	3 days
This commit is contained in:
Andriy Voskoboinyk 2019-02-02 16:15:46 +00:00
parent 6ecec3817e
commit 4215ce4820
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=343682

View File

@ -373,7 +373,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
@ -602,6 +602,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;