OSDN Git Service

net: bcmgenet: fix dma api length mismatch
authorEric Dumazet <edumazet@google.com>
Thu, 17 Mar 2016 18:57:06 +0000 (11:57 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2016 06:42:04 +0000 (15:42 +0900)
commit7a0e9a08642993bfde0dd03a5a3f825869cc4d06
tree5f8c7fe34907e3055e2041f1b4adcbe8882839cc
parenta5ce25f61bce0ffb1ff59071c06b948277c90a28
net: bcmgenet: fix dma api length mismatch

[ Upstream commit eee577232203842b4dcadb7ab477a298479633ed ]

When un-mapping skb->data in __bcmgenet_tx_reclaim(),
we must use the length that was used in original dma_map_single(),
instead of skb->len that might be bigger (includes the frags)

We simply can store skb_len into tx_cb_ptr->dma_len and use it
at unmap time.

Fixes: 1c1008c793fa ("net: bcmgenet: add main driver file")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/broadcom/genet/bcmgenet.c