Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2ef12d3 authored by Rami Rosen's avatar Rami Rosen Committed by John W. Linville
Browse files

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: default avatarRami Rosen <ramirose@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 72118015
Loading
Loading
Loading
Loading
+55 −49
Original line number Original line Diff line number Diff line
@@ -1379,6 +1379,13 @@ static int ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
	struct ieee80211_supported_band *sband;
	struct ieee80211_supported_band *sband;
	union iwreq_data wrqu;
	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];
	sband = local->hw.wiphy->bands[local->hw.conf.channel->band];


	/* Remove possible STA entries from other IBSS networks. */
	/* 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;
		return res;


	/* Build IBSS probe response */
	/* Build IBSS probe response */
	skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400);

	if (skb) {
	skb_reserve(skb, local->hw.extra_tx_headroom);
	skb_reserve(skb, local->hw.extra_tx_headroom);


	mgmt = (struct ieee80211_mgmt *)
	mgmt = (struct ieee80211_mgmt *)
@@ -1459,7 +1465,7 @@ static int ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
	ifsta->probe_resp = skb;
	ifsta->probe_resp = skb;


	ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON);
	ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON);
	}



	rates = 0;
	rates = 0;
	sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
	sband = local->hw.wiphy->bands[local->hw.conf.channel->band];