net: fec: fix missing kmalloc() failure check in fec_enet_alloc_buffers()
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 7 Jul 2014 23:23:30 +0000 (00:23 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Jul 2014 04:21:23 +0000 (21:21 -0700)
commitffdce2cc6a18e3460fd31a399934004bf4cf6539
tree995647ca7efe3a7c9c8fd369c2dd66334122099b
parent8b7c9efa018f96e58fa379ddb8c03f002c4f6a84
net: fec: fix missing kmalloc() failure check in fec_enet_alloc_buffers()

fec_enet_alloc_buffers() assumes that kmalloc() will never fail, which
is an invalid assumption.  Fix this by implementing a common error
cleanup path, and use it to also clean up after failed bounce buffer
allocation.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c