Skip to content

Commit

Permalink
staging: vt6656: free skbuff and relocate on bReAllocSkb == FALSE.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Malcolm Priestley authored and Greg Kroah-Hartman committed Nov 13, 2012
1 parent 87c6298 commit 28044e0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/staging/vt6656/dpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 28044e0

Please sign in to comment.