linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, "Arend van Spriel" <arend@broadcom.com>
Subject: [PATCH 11/13] brcmfmac: assure brcmf_txcomplete() is called in failure paths
Date: Sun, 3 Mar 2013 12:45:30 +0100	[thread overview]
Message-ID: <1362311132-29561-12-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1362311132-29561-1-git-send-email-arend@broadcom.com>

For transmit packets the function brcmf_txcomplete() must be
called. This should be done as well when for some reason the
transmit fails to assure proper tx post processing. This patch
fixes the code paths in brcmf_usb_tx() that forgot to do so.

Reviewed-by: Piotr Haber <phaber@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 drivers/net/wireless/brcm80211/brcmfmac/usb.c |   29 ++++++++++++++----------
 1 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
index 28f7764..a14e12f 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
@@ -571,15 +571,17 @@ static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb)
 	int ret;
 
 	brcmf_dbg(USB, "Enter, skb=%p\n", skb);
-	if (devinfo->bus_pub.state != BRCMFMAC_USB_STATE_UP)
-		return -EIO;
+	if (devinfo->bus_pub.state != BRCMFMAC_USB_STATE_UP) {
+		ret = -EIO;
+		goto fail;
+	}
 
 	req = brcmf_usb_deq(devinfo, &devinfo->tx_freeq,
 					&devinfo->tx_freecount);
 	if (!req) {
-		brcmu_pkt_buf_free_skb(skb);
 		brcmf_err("no req to send\n");
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto fail;
 	}
 
 	req->skb = skb;
@@ -592,18 +594,21 @@ static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb)
 	if (ret) {
 		brcmf_err("brcmf_usb_tx usb_submit_urb FAILED\n");
 		brcmf_usb_del_fromq(devinfo, req);
-		brcmu_pkt_buf_free_skb(req->skb);
 		req->skb = NULL;
 		brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req,
-						&devinfo->tx_freecount);
-	} else {
-		if (devinfo->tx_freecount < devinfo->tx_low_watermark &&
-			!devinfo->tx_flowblock) {
-			brcmf_txflowblock(dev, true);
-			devinfo->tx_flowblock = true;
-		}
+			      &devinfo->tx_freecount);
+		goto fail;
 	}
 
+	if (devinfo->tx_freecount < devinfo->tx_low_watermark &&
+	    !devinfo->tx_flowblock) {
+		brcmf_txflowblock(dev, true);
+		devinfo->tx_flowblock = true;
+	}
+	return 0;
+
+fail:
+	brcmf_txcomplete(dev, skb, false);
 	return ret;
 }
 
-- 
1.7.6



  parent reply	other threads:[~2013-03-03 11:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-03 11:45 [PATCH 00/13] brcm80211: cleanup and rework changes Arend van Spriel
2013-03-03 11:45 ` [PATCH 01/13] brcmsmac: radio on led support Arend van Spriel
2013-03-03 11:45 ` [PATCH 02/13] brcmfmac: introduce tracepoints for message logging Arend van Spriel
2013-03-03 11:45 ` [PATCH 03/13] brcmfmac: make debug module parameter more clear Arend van Spriel
2013-03-03 11:45 ` [PATCH 04/13] brcmfmac: cleanup module information macros Arend van Spriel
2013-03-03 11:45 ` [PATCH 05/13] brcmfmac: only do auth_type workaround when no WPA or RSN IE is provided Arend van Spriel
2013-03-03 17:20   ` Johannes Berg
2013-03-03 19:47     ` Arend van Spriel
2013-03-03 20:35       ` Johannes Berg
2013-03-04  8:29         ` Arend van Spriel
2013-03-03 11:45 ` [PATCH 06/13] brcmfmac: remove null-pointer check in .sched_scan_start() callback Arend van Spriel
2013-03-03 11:45 ` [PATCH 07/13] brcmfmac: increase required skbuff headroom for firmware signalling Arend van Spriel
2013-03-03 11:45 ` [PATCH 08/13] brcmutil: add macros for setting bitfields using mask/shift operations Arend van Spriel
2013-03-03 11:45 ` [PATCH 09/13] brcmfmac: add support for TLV based firmware signalling Arend van Spriel
2013-03-03 11:45 ` [PATCH 10/13] brcmfmac: release transmit packet in brcmf_txcomplete() Arend van Spriel
2013-03-03 11:45 ` Arend van Spriel [this message]
2013-03-03 11:45 ` [PATCH 12/13] brcmutil: add dequeue function with filtering Arend van Spriel
2013-03-03 11:45 ` [PATCH 13/13] brcmfmac: add parameter to brcmf_proto_hdrpush() for data offset Arend van Spriel

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=1362311132-29561-12-git-send-email-arend@broadcom.com \
    --to=arend@broadcom.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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;
as well as URLs for NNTP newsgroup(s).