atl1e: unmap partially mapped skb on dma error and free skb
authorNeil Horman <nhorman@tuxdriver.com>
Tue, 16 Jul 2013 14:49:41 +0000 (10:49 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 2 Aug 2013 20:14:50 +0000 (22:14 +0200)
commit729c5244dac355ca8c81f402739c218cc3212a10
tree60d55c9efde3dbcb76594cb4eb94fce5766b6102
parent70513e78db3910edc5ba74ca5f31f6e619acac97
atl1e: unmap partially mapped skb on dma error and free skb

[ Upstream commit 584ec4355355ffac43571b02a314d43eb2f7fcbf ]

Ben Hutchings pointed out that my recent update to atl1e
in commit 352900b583b2852152a1e05ea0e8b579292e731e
("atl1e: fix dma mapping warnings") was missing a bit of code.

Specifically it reset the hardware tx ring to its origional state when
we hit a dma error, but didn't unmap any exiting mappings from the
operation.  This patch fixes that up.  It also remembers to free the
skb in the event that an error occurs, so we don't leak.  Untested, as
I don't have hardware.  I think its pretty straightforward, but please
review closely.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Ben Hutchings <bhutchings@solarflare.com>
CC: Jay Cliburn <jcliburn@gmail.com>
CC: Chris Snook <chris.snook@gmail.com>
CC: "David S. Miller" <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/ethernet/atheros/atl1e/atl1e_main.c