mac80211: check return value of dev_alloc_skb() in ieee80211_sta_join_ibss().

This patch add a check on the return value of dev_alloc_skb() in
ieee80211_sta_join_ibss() in net/mac80211/mlme.c.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Rami Rosen 2008-10-22 09:58:39 +02:00 committed by John W. Linville
parent 7211801527
commit e2ef12d3fd

View File

@ -1379,6 +1379,13 @@ static int ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
struct ieee80211_supported_band *sband;
union iwreq_data wrqu;
skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400);
if (!skb) {
printk(KERN_DEBUG "%s: failed to allocate buffer for probe "
"response\n", sdata->dev->name);
return -ENOMEM;
}
sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
/* Remove possible STA entries from other IBSS networks. */
@ -1404,8 +1411,7 @@ static int ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
return res;
/* Build IBSS probe response */
skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400);
if (skb) {
skb_reserve(skb, local->hw.extra_tx_headroom);
mgmt = (struct ieee80211_mgmt *)
@ -1459,7 +1465,7 @@ static int ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
ifsta->probe_resp = skb;
ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON);
}
rates = 0;
sband = local->hw.wiphy->bands[local->hw.conf.channel->band];