summaryrefslogtreecommitdiffstats
path: root/drivers/staging/vt6656/dpc.c
diff options
context:
space:
mode:
authorMalcolm Priestley2012-11-04 18:20:06 +0100
committerGreg Kroah-Hartman2012-11-13 21:45:43 +0100
commit28044e0193f2d642a4981dd296b2583b30cf36ef (patch)
tree7b5b869d48de43738433590963f0c937bb1403cb /drivers/staging/vt6656/dpc.c
parentstaging: vt6656: no need to bIndicateReceive when no bytes to read. (diff)
downloadkernel-qcow2-linux-28044e0193f2d642a4981dd296b2583b30cf36ef.tar.gz
kernel-qcow2-linux-28044e0193f2d642a4981dd296b2583b30cf36ef.tar.xz
kernel-qcow2-linux-28044e0193f2d642a4981dd296b2583b30cf36ef.zip
staging: vt6656: free skbuff and relocate on bReAllocSkb == FALSE.
bReAllocSkb == FALSE is when data is not fed to user land. Free and relocate skbuff. Where data is not sent return = FALSE from RXbBulkInProcessData. This appears to reduce false errors when a reused skbuff has old data. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656/dpc.c')
-rw-r--r--drivers/staging/vt6656/dpc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
index 28edf9e7efcb..5ad7abb869a4 100644
--- a/drivers/staging/vt6656/dpc.c
+++ b/drivers/staging/vt6656/dpc.c
@@ -617,7 +617,7 @@ RXbBulkInProcessData (
//Discard beacon packet which channel is 0
if ( (WLAN_GET_FC_FSTYPE((pRxPacket->p80211Header->sA3.wFrameCtl)) == WLAN_FSTYPE_BEACON) ||
(WLAN_GET_FC_FSTYPE((pRxPacket->p80211Header->sA3.wFrameCtl)) == WLAN_FSTYPE_PROBERESP) ) {
- return TRUE;
+ return FALSE;
}
}
pRxPacket->byRxChannel = (*pbyRxSts) >> 2;
@@ -912,7 +912,7 @@ RXbBulkInProcessData (
pDevice->skb->protocol = htons(ETH_P_802_2);
memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
netif_rx(pDevice->skb);
- pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz);
+ return TRUE;
}
return FALSE;
@@ -1534,6 +1534,11 @@ RXvFreeRCB(
ASSERT(!pRCB->Ref); // should be 0
ASSERT(pRCB->pDevice); // shouldn't be NULL
+ if (bReAllocSkb == FALSE) {
+ kfree_skb(pRCB->skb);
+ bReAllocSkb = TRUE;
+ }
+
if (bReAllocSkb == TRUE) {
pRCB->skb = dev_alloc_skb((int)pDevice->rx_buf_sz);
// todo error handling