]> git.baikalelectronics.ru Git - kernel.git/commit
net: calxedaxgmac: fix rx DMA mapping API size mismatches
authorRob Herring <rob.herring@calxeda.com>
Fri, 30 Aug 2013 21:49:28 +0000 (16:49 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Sep 2013 02:21:16 +0000 (22:21 -0400)
commit5f42b5cb7ea060da7625dca3cadf95eb300c000b
treed7b0756ac82ccc95de95ecb8e037a2fe9795f355
parent518d3b23aa1e6ac0c5b4d3d3b9cd17c6d72e7d9b
net: calxedaxgmac: fix rx DMA mapping API size mismatches

Fix the mismatch in the DMA mapping and unmapping sizes for receive. The
unmap size must be equal to the map size and should not be the actual
received frame length. The map size should also be adjusted by the
NET_IP_ALIGN size since the h/w buffer size (dma_buf_sz) includes this
offset.

Also, add a missing dma_mapping_error check in xgmac_rx_refill.

Reported-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/calxeda/xgmac.c