mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	alan@lxorguk.ukuu.org.uk, Felix Fietkau <nbd@openwrt.org>,
	"John W. Linville" <linville@tuxdriver.com>
Subject: [ 30/62] ath9k: use ieee80211_free_txskb
Date: Thu, 18 Oct 2012 19:44:58 -0700	[thread overview]
Message-ID: <20121019024300.835482523@linuxfoundation.org> (raw)
In-Reply-To: <20121019024255.944999470@linuxfoundation.org>

3.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Felix Fietkau <nbd@openwrt.org>

commit 249ee72249140fe5b9adc988f97298f0aa5db2fc upstream.

Using ieee80211_free_txskb for tx frames is required, since mac80211 clones
skbs for which socket tx status is requested.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/ath/ath9k/beacon.c |    2 -
 drivers/net/wireless/ath/ath9k/main.c   |    2 -
 drivers/net/wireless/ath/ath9k/xmit.c   |   53 +++++++++++++++++---------------
 3 files changed, 31 insertions(+), 26 deletions(-)

--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -121,7 +121,7 @@ static void ath_tx_cabq(struct ieee80211
 
 	if (ath_tx_start(hw, skb, &txctl) != 0) {
 		ath_dbg(common, XMIT, "CABQ TX failed\n");
-		dev_kfree_skb_any(skb);
+		ieee80211_free_txskb(hw, skb);
 	}
 }
 
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1147,7 +1147,7 @@ static void ath9k_tx(struct ieee80211_hw
 
 	return;
 exit:
-	dev_kfree_skb_any(skb);
+	ieee80211_free_txskb(hw, skb);
 }
 
 static void ath9k_stop(struct ieee80211_hw *hw)
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -64,8 +64,7 @@ static void ath_tx_update_baw(struct ath
 static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc,
 					   struct ath_txq *txq,
 					   struct ath_atx_tid *tid,
-					   struct sk_buff *skb,
-					   bool dequeue);
+					   struct sk_buff *skb);
 
 enum {
 	MCS_HT20,
@@ -201,7 +200,15 @@ static void ath_tx_flush_tid(struct ath_
 		fi = get_frame_info(skb);
 		bf = fi->bf;
 
-		if (bf && fi->retries) {
+		if (!bf) {
+			bf = ath_tx_setup_buffer(sc, txq, tid, skb);
+			if (!bf) {
+				ieee80211_free_txskb(sc->hw, skb);
+				continue;
+			}
+		}
+
+		if (fi->retries) {
 			list_add_tail(&bf->list, &bf_head);
 			ath_tx_update_baw(sc, tid, bf->bf_state.seqno);
 			ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
@@ -812,10 +819,13 @@ static enum ATH_AGGR_STATUS ath_tx_form_
 		fi = get_frame_info(skb);
 		bf = fi->bf;
 		if (!fi->bf)
-			bf = ath_tx_setup_buffer(sc, txq, tid, skb, true);
+			bf = ath_tx_setup_buffer(sc, txq, tid, skb);
 
-		if (!bf)
+		if (!bf) {
+			__skb_unlink(skb, &tid->buf_q);
+			ieee80211_free_txskb(sc->hw, skb);
 			continue;
+		}
 
 		bf->bf_state.bf_type = BUF_AMPDU | BUF_AGGR;
 		seqno = bf->bf_state.seqno;
@@ -1717,9 +1727,11 @@ static void ath_tx_send_ampdu(struct ath
 		return;
 	}
 
-	bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb, false);
-	if (!bf)
+	bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb);
+	if (!bf) {
+		ieee80211_free_txskb(sc->hw, skb);
 		return;
+	}
 
 	bf->bf_state.bf_type = BUF_AMPDU;
 	INIT_LIST_HEAD(&bf_head);
@@ -1743,11 +1755,6 @@ static void ath_tx_send_normal(struct at
 	struct ath_buf *bf;
 
 	bf = fi->bf;
-	if (!bf)
-		bf = ath_tx_setup_buffer(sc, txq, tid, skb, false);
-
-	if (!bf)
-		return;
 
 	INIT_LIST_HEAD(&bf_head);
 	list_add_tail(&bf->list, &bf_head);
@@ -1820,8 +1827,7 @@ u8 ath_txchainmask_reduction(struct ath_
 static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc,
 					   struct ath_txq *txq,
 					   struct ath_atx_tid *tid,
-					   struct sk_buff *skb,
-					   bool dequeue)
+					   struct sk_buff *skb)
 {
 	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
 	struct ath_frame_info *fi = get_frame_info(skb);
@@ -1833,7 +1839,7 @@ static struct ath_buf *ath_tx_setup_buff
 	bf = ath_tx_get_buffer(sc);
 	if (!bf) {
 		ath_dbg(common, XMIT, "TX buffers are full\n");
-		goto error;
+		return NULL;
 	}
 
 	ATH_TXBUF_RESET(bf);
@@ -1862,18 +1868,12 @@ static struct ath_buf *ath_tx_setup_buff
 		ath_err(ath9k_hw_common(sc->sc_ah),
 			"dma_mapping_error() on TX\n");
 		ath_tx_return_buffer(sc, bf);
-		goto error;
+		return NULL;
 	}
 
 	fi->bf = bf;
 
 	return bf;
-
-error:
-	if (dequeue)
-		__skb_unlink(skb, &tid->buf_q);
-	dev_kfree_skb_any(skb);
-	return NULL;
 }
 
 /* FIXME: tx power */
@@ -1902,9 +1902,14 @@ static void ath_tx_start_dma(struct ath_
 		 */
 		ath_tx_send_ampdu(sc, tid, skb, txctl);
 	} else {
-		bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb, false);
-		if (!bf)
+		bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb);
+		if (!bf) {
+			if (txctl->paprd)
+				dev_kfree_skb_any(skb);
+			else
+				ieee80211_free_txskb(sc->hw, skb);
 			return;
+		}
 
 		bf->bf_state.bfs_paprd = txctl->paprd;
 



  parent reply	other threads:[~2012-10-19  3:29 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-19  2:44 [ 00/62] 3.4.15-stable review Greg Kroah-Hartman
2012-10-19  2:44 ` [ 01/62] ARM: vfp: fix saving d16-d31 vfp registers on v6+ kernels Greg Kroah-Hartman
2012-10-19  2:44 ` [ 02/62] nfsd4: fix nfs4 stateid leak Greg Kroah-Hartman
2012-10-19  2:44 ` [ 03/62] NFSD: pass null terminated buf to kstrtouint() Greg Kroah-Hartman
2012-10-19  2:44 ` [ 04/62] lockd: use rpc clients cl_nodename for id encoding Greg Kroah-Hartman
2012-10-19  2:44 ` [ 05/62] ACPI: EC: Make the GPE storm threshold a module parameter Greg Kroah-Hartman
2012-10-19  2:44 ` [ 06/62] ACPI: EC: Add a quirk for CLEVO M720T/M730T laptop Greg Kroah-Hartman
2012-10-19  2:44 ` [ 07/62] ALSA: hda - do not detect jack on internal speakers for Realtek Greg Kroah-Hartman
2012-10-19  2:44 ` [ 08/62] ALSA: hda - Fix memory leaks at error path in patch_cirrus.c Greg Kroah-Hartman
2012-10-19  2:44 ` [ 09/62] mips,kgdb: fix recursive page fault with CONFIG_KPROBES Greg Kroah-Hartman
2012-10-19  2:44 ` [ 10/62] tmpfs,ceph,gfs2,isofs,reiserfs,xfs: fix fh_len checking Greg Kroah-Hartman
2012-10-19  2:44 ` [ 11/62] SCSI: hpsa: dial down lockup detection during firmware flash Greg Kroah-Hartman
2012-10-19  2:44 ` [ 12/62] iscsi-target: Correctly set 0xffffffff field within ISCSI_OP_REJECT PDU Greg Kroah-Hartman
2012-10-19  2:44 ` [ 13/62] iscsit: remove incorrect unlock in iscsit_build_sendtargets_resp Greg Kroah-Hartman
2012-10-19  2:44 ` [ 14/62] iscsi-target: Add explicit set of cache_dynamic_acls=1 for TPG demo-mode Greg Kroah-Hartman
2012-10-19  2:44 ` [ 15/62] iscsi-target: Bump defaults for nopin_timeout + nopin_response_timeout values Greg Kroah-Hartman
2012-10-19  2:44 ` [ 16/62] SCSI: storvsc: Account for in-transit packets in the RESET path Greg Kroah-Hartman
2012-10-19  2:44 ` [ 17/62] SCSI: scsi_debug: Fix off-by-one bug when unmapping region Greg Kroah-Hartman
2012-10-19  2:44 ` [ 18/62] ARM: 7541/1: Add ARM ERRATA 775420 workaround Greg Kroah-Hartman
2012-10-19  2:44 ` [ 19/62] firewire: cdev: fix user memory corruption (i386 userland on amd64 kernel) Greg Kroah-Hartman
2012-10-19  2:44 ` [ 20/62] SUNRPC: Ensure that the TCP socket is closed when in CLOSE_WAIT Greg Kroah-Hartman
2012-10-19  2:44 ` [ 21/62] target: fix return code in target_core_init_configfs error path Greg Kroah-Hartman
2012-10-19  2:44 ` [ 22/62] xen/bootup: allow {read|write}_cr8 pvops call Greg Kroah-Hartman
2012-10-19  2:44 ` [ 23/62] xen/bootup: allow read_tscp call for Xen PV guests Greg Kroah-Hartman
2012-10-19  2:44 ` [ 24/62] block: fix request_queue->flags initialization Greg Kroah-Hartman
2012-10-19  2:44 ` [ 25/62] autofs4 - fix reset pending flag on mount fail Greg Kroah-Hartman
2012-10-19  2:44 ` [ 26/62] module: taint kernel when lve module is loaded Greg Kroah-Hartman
2012-10-19  2:44 ` [ 27/62] video/udlfb: fix line counting in fb_write Greg Kroah-Hartman
2012-10-19  2:44 ` [ 28/62] viafb: dont touch clock state on OLPC XO-1.5 Greg Kroah-Hartman
2012-10-19  2:44 ` [ 29/62] timers: Fix endless looping between cascade() and internal_add_timer() Greg Kroah-Hartman
2012-10-19  2:44 ` Greg Kroah-Hartman [this message]
2012-10-19  2:44 ` [ 31/62] md/raid10: use correct limit variable Greg Kroah-Hartman
2012-10-19  2:45 ` [ 32/62] kdb,vt_console: Fix missed data due to pager overruns Greg Kroah-Hartman
2012-10-19 21:39   ` Ben Hutchings
2012-10-19  2:45 ` [ 33/62] pktgen: fix crash when generating IPv6 packets Greg Kroah-Hartman
2012-10-19  2:45 ` [ 34/62] ipvs: fix oops in ip_vs_dst_event on rmmod Greg Kroah-Hartman
2012-10-19  2:45 ` [ 35/62] netfilter: nf_conntrack: fix racy timer handling with reliable events Greg Kroah-Hartman
2012-10-19  2:45 ` [ 36/62] netfilter: ipset: fix timeout value overflow bug Greg Kroah-Hartman
2012-10-19  2:45 ` [ 37/62] netfilter: ipset: timeout fixing bug broke SET target special timeout value Greg Kroah-Hartman
2012-10-19  2:45 ` [ 38/62] ipvs: fix oops on NAT reply in br_nf context Greg Kroah-Hartman
2012-10-19  2:45 ` [ 39/62] netfilter: nf_nat_sip: fix incorrect handling of EBUSY for RTCP expectation Greg Kroah-Hartman
2012-10-19  2:45 ` [ 40/62] netfilter: nf_nat_sip: fix via header translation with multiple parameters Greg Kroah-Hartman
2012-10-19  2:45 ` [ 41/62] netfilter: nf_ct_expect: fix possible access to uninitialized timer Greg Kroah-Hartman
2012-10-19  2:45 ` [ 42/62] netfilter: limit, hashlimit: avoid duplicated inline Greg Kroah-Hartman
2012-10-19  2:45 ` [ 43/62] netfilter: xt_limit: have r->cost != 0 case work Greg Kroah-Hartman
2012-10-19  2:45 ` [ 44/62] Add CDC-ACM support for the CX93010-2x UCMxx USB Modem Greg Kroah-Hartman
2012-10-19  2:45 ` [ 45/62] drm/radeon: Dont destroy I2C Bus Rec in radeon_ext_tmds_enc_destroy() Greg Kroah-Hartman
2012-10-19  2:45 ` [ 46/62] drm/i915: use adjusted_mode instead of mode for checking the 6bpc force flag Greg Kroah-Hartman
2012-10-19  2:45 ` [ 47/62] jbd: Fix assertion failure in commit code due to lacking transaction credits Greg Kroah-Hartman
2012-10-19  2:45 ` [ 48/62] e1000e: Change wthresh to 1 to avoid possible Tx stalls Greg Kroah-Hartman
2012-10-19  2:45 ` [ 49/62] tpm: Propagate error from tpm_transmit to fix a timeout hang Greg Kroah-Hartman
2012-10-19  2:45 ` [ 50/62] eCryptfs: Unlink lower inode when ecryptfs_create() fails Greg Kroah-Hartman
2012-10-19  2:45 ` [ 51/62] eCryptfs: Initialize empty lower files when opening them Greg Kroah-Hartman
2012-10-19  2:45 ` [ 52/62] eCryptfs: Revert to a writethrough cache model Greg Kroah-Hartman
2012-10-19  2:45 ` [ 53/62] eCryptfs: Write out all dirty pages just before releasing the lower file Greg Kroah-Hartman
2012-10-19  2:45 ` [ 54/62] eCryptfs: Call lower ->flush() from ecryptfs_flush() Greg Kroah-Hartman
2012-10-19  2:45 ` [ 55/62] usb: gadget: at91_udc: fix dt support Greg Kroah-Hartman
2012-10-19  2:45 ` [ 56/62] ALSA: hda - Always check array bounds in alc_get_line_out_pfx Greg Kroah-Hartman
2012-10-19  2:45 ` [ 57/62] ASoC: fsi: dont reschedule DMA from an atomic context Greg Kroah-Hartman
2012-10-19  2:45 ` [ 58/62] ASoC: wm2200: Use rev A register patches on rev B Greg Kroah-Hartman
2012-10-19  2:45 ` [ 59/62] ASoC: wm2200: Fix non-inverted OUT2 mute control Greg Kroah-Hartman
2012-10-19  2:45 ` [ 60/62] ASoC: omap-abe-twl6040: Fix typo of Vibrator Greg Kroah-Hartman
2012-10-19  2:45 ` [ 61/62] ALSA: ac97 - Fix missing NULL check in snd_ac97_cvol_new() Greg Kroah-Hartman
2012-10-19  2:45 ` [ 62/62] ALSA: emu10k1: add chip details for E-mu 1010 PCIe card Greg Kroah-Hartman

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=20121019024300.835482523@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=nbd@openwrt.org \
    --cc=stable@vger.kernel.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

Powered by JetHome