8139cp: Add dma_mapping_error checking
authorNeil Horman <nhorman@tuxdriver.com>
Wed, 31 Jul 2013 13:03:56 +0000 (09:03 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 26 Oct 2013 20:05:56 +0000 (21:05 +0100)
commit5cacde1a5f5e7c958dd1f2f74fd57fc3bf176784
treed7929225c2ce23d8d2f5e620ed503b8d669b27d6
parent729d6632adca3fc51a2114862926e0343e0fe744
8139cp: Add dma_mapping_error checking

[ Upstream commits cf3c4c03060b688cbc389ebc5065ebcce5653e96 and
  d06f5187469eee1b2932c02fd093d113cfc60d5e (the latter is a fixup
  from Dave Jones) ]

Self explanitory dma_mapping_error addition to the 8139 driver, based on this:
https://bugzilla.redhat.com/show_bug.cgi?id=947250

It showed several backtraces arising for dma_map_* usage without checking the
return code on the mapping.  Add the check and abort the rx/tx operation if its
failed.  Untested as I have no hardware and the reporter has wandered off, but
seems pretty straightforward.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/ethernet/realtek/8139cp.c