Commit 6fc9ca13 authored by Arend van Spriel's avatar Arend van Spriel Committed by John W. Linville

brcmfmac: assure brcmf_txcomplete() is called in failure paths

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: default avatarPiotr Haber <phaber@broadcom.com>
Reviewed-by: default avatarHante Meuleman <meuleman@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 7f4bceec
...@@ -570,15 +570,17 @@ static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb) ...@@ -570,15 +570,17 @@ static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb)
int ret; int ret;
brcmf_dbg(USB, "Enter, skb=%p\n", skb); brcmf_dbg(USB, "Enter, skb=%p\n", skb);
if (devinfo->bus_pub.state != BRCMFMAC_USB_STATE_UP) if (devinfo->bus_pub.state != BRCMFMAC_USB_STATE_UP) {
return -EIO; ret = -EIO;
goto fail;
}
req = brcmf_usb_deq(devinfo, &devinfo->tx_freeq, req = brcmf_usb_deq(devinfo, &devinfo->tx_freeq,
&devinfo->tx_freecount); &devinfo->tx_freecount);
if (!req) { if (!req) {
brcmu_pkt_buf_free_skb(skb);
brcmf_err("no req to send\n"); brcmf_err("no req to send\n");
return -ENOMEM; ret = -ENOMEM;
goto fail;
} }
req->skb = skb; req->skb = skb;
...@@ -591,18 +593,21 @@ static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb) ...@@ -591,18 +593,21 @@ static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb)
if (ret) { if (ret) {
brcmf_err("brcmf_usb_tx usb_submit_urb FAILED\n"); brcmf_err("brcmf_usb_tx usb_submit_urb FAILED\n");
brcmf_usb_del_fromq(devinfo, req); brcmf_usb_del_fromq(devinfo, req);
brcmu_pkt_buf_free_skb(req->skb);
req->skb = NULL; req->skb = NULL;
brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req, brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req,
&devinfo->tx_freecount); &devinfo->tx_freecount);
} else { goto fail;
}
if (devinfo->tx_freecount < devinfo->tx_low_watermark && if (devinfo->tx_freecount < devinfo->tx_low_watermark &&
!devinfo->tx_flowblock) { !devinfo->tx_flowblock) {
brcmf_txflowblock(dev, true); brcmf_txflowblock(dev, true);
devinfo->tx_flowblock = true; devinfo->tx_flowblock = true;
} }
} return 0;
fail:
brcmf_txcomplete(dev, skb, false);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment