From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
Bob Copeland <me@bobcopeland.com>,
"John W. Linville" <linville@tuxdriver.com>
Subject: [20/26] ath5k: fix error handling in ath5k_beacon_send
Date: Mon, 15 Aug 2011 19:43:03 -0700 [thread overview]
Message-ID: <20110816024455.118844840@pistachio.kroah.org> (raw)
In-Reply-To: <20110816024553.GA5631@kroah.com>
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bob Copeland <me@bobcopeland.com>
commit bdc71bc59231f5542af13b5061b9ab124d093050 upstream.
This cleans up error handling for the beacon in case of dma mapping
failure. We need to free the skb when dma mapping fails instead of
nulling and leaking the pointer, and we should bail out to avoid
giving the hardware the bad descriptor.
Finally, we need to perform the null check after trying to update
the beacon, or else beacons will never be sent after a single
mapping failure.
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/wireless/ath/ath5k/base.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1748,6 +1748,8 @@ ath5k_beacon_setup(struct ath5k_softc *s
if (dma_mapping_error(sc->dev, bf->skbaddr)) {
ATH5K_ERR(sc, "beacon DMA mapping failed\n");
+ dev_kfree_skb_any(skb);
+ bf->skb = NULL;
return -EIO;
}
@@ -1832,8 +1834,6 @@ ath5k_beacon_update(struct ieee80211_hw
ath5k_txbuf_free_skb(sc, avf->bbuf);
avf->bbuf->skb = skb;
ret = ath5k_beacon_setup(sc, avf->bbuf);
- if (ret)
- avf->bbuf->skb = NULL;
out:
return ret;
}
@@ -1854,6 +1854,7 @@ ath5k_beacon_send(struct ath5k_softc *sc
struct ath5k_vif *avf;
struct ath5k_buf *bf;
struct sk_buff *skb;
+ int err;
ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON, "in beacon_send\n");
@@ -1902,11 +1903,6 @@ ath5k_beacon_send(struct ath5k_softc *sc
avf = (void *)vif->drv_priv;
bf = avf->bbuf;
- if (unlikely(bf->skb == NULL || sc->opmode == NL80211_IFTYPE_STATION ||
- sc->opmode == NL80211_IFTYPE_MONITOR)) {
- ATH5K_WARN(sc, "bf=%p bf_skb=%p\n", bf, bf ? bf->skb : NULL);
- return;
- }
/*
* Stop any current dma and put the new frame on the queue.
@@ -1920,8 +1916,17 @@ ath5k_beacon_send(struct ath5k_softc *sc
/* refresh the beacon for AP or MESH mode */
if (sc->opmode == NL80211_IFTYPE_AP ||
- sc->opmode == NL80211_IFTYPE_MESH_POINT)
- ath5k_beacon_update(sc->hw, vif);
+ sc->opmode == NL80211_IFTYPE_MESH_POINT) {
+ err = ath5k_beacon_update(sc->hw, vif);
+ if (err)
+ return;
+ }
+
+ if (unlikely(bf->skb == NULL || sc->opmode == NL80211_IFTYPE_STATION ||
+ sc->opmode == NL80211_IFTYPE_MONITOR)) {
+ ATH5K_WARN(sc, "bf=%p bf_skb=%p\n", bf, bf->skb);
+ return;
+ }
trace_ath5k_tx(sc, bf->skb, &sc->txqs[sc->bhalq]);
next prev parent reply other threads:[~2011-08-16 2:51 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-16 2:45 [00/26] 3.0.3-stable review Greg KH
2011-08-16 2:42 ` [01/26] staging: rtl8192u: declare MODULE_FIRMWARE Greg KH
2011-08-16 2:42 ` [02/26] USB: xhci: fix OS want to own HC Greg KH
2011-08-16 2:42 ` [03/26] xhci: Dont submit commands or URBs to halted hosts Greg KH
2011-08-16 2:42 ` [04/26] usb/config: use proper endian access for wMaxPacketSize Greg KH
2011-08-16 2:42 ` [05/26] usb: musb: fix oops on musb_gadget_pullup Greg KH
2011-08-16 2:42 ` [06/26] USB: assign instead of equal in usbtmc.c Greg KH
2011-08-16 2:42 ` [07/26] USB: ftdi_sio: fix minor typo in get_ftdi_divisor Greg KH
2011-08-16 2:42 ` [08/26] USB: usb-storage: unusual_devs entry for ARM V2M Greg KH
2011-08-16 2:42 ` [09/26] USB: Serial: Added device ID for Qualcomm Modem in Greg KH
2011-08-16 2:42 ` [10/26] USB: option driver: add PID for Vodafone-Huawei K3770 Greg KH
2011-08-16 2:42 ` [11/26] USB: option driver: add PID for Vodafone-Huawei K3771 Greg KH
2011-08-16 2:42 ` [12/26] USB: option driver: add PID for Vodafone-Huawei K4510 Greg KH
2011-08-16 2:42 ` [13/26] USB: option driver: add PID for Vodafone-Huawei K4511 Greg KH
2011-08-16 2:42 ` [14/26] atm: br2864: sent packets truncated in VC routed mode Greg KH
2011-08-16 2:42 ` [15/26] hwmon: (ibmaem) add missing kfree Greg KH
2011-08-16 2:42 ` [16/26] ALSA: snd-usb-caiaq: Correct offset fields of outbound iso_frame_desc Greg KH
2011-08-16 2:43 ` [17/26] ASoC: Fix binding of WM8750 on Jive Greg KH
2011-08-16 2:43 ` [18/26] ASoC: Tegra: tegra_pcm_deallocate_dma_buffer: Dont OOPS Greg KH
2011-08-16 2:43 ` [19/26] ASoC: Tegra: wm8903 machine driver: Allow re-insertion of Greg KH
2011-08-16 2:43 ` Greg KH [this message]
2011-08-16 2:43 ` [21/26] mm: fix wrong vmap address calculations with odd NR_CPUS values Greg KH
2011-08-16 2:43 ` [22/26] lguest: allow booting guest with CONFIG_RELOCATABLE=y Greg KH
2011-08-16 2:43 ` [23/26] drm/radeon/kms: dont enable connectors that are off in the Greg KH
2011-08-16 2:43 ` [24/26] drm/radeon/kms: fix regression is handling >2 heads on Greg KH
2011-08-16 2:43 ` [25/26] drm/radeon/kms: dont try to be smart in the hpd handler Greg KH
2011-08-16 2:43 ` [26/26] perf tools: do not look at ./config for configuration Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110816024455.118844840@pistachio.kroah.org \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=me@bobcopeland.com \
--cc=stable-review@kernel.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®