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)
commit531cda20cd44d5a7a77debaaeaa407d4802d7e05
treed7b0756ac82ccc95de95ecb8e037a2fe9795f355
parentd2a5128fbc30480763bbb8a43ec7c8161c1bf055
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