stmmac: fix init_dma_desc_rings() to handle errors
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Fri, 9 Aug 2013 12:02:08 +0000 (14:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Aug 2013 05:11:29 +0000 (22:11 -0700)
commit56329137211639528ddf05c59a9d7cbde6879d1f
tree56fdb14424a595d3ca19f4df2aac84a18ecf87c5
parentd4cca39d90fca21c04315095de5d0e734e839a8b
stmmac: fix init_dma_desc_rings() to handle errors

In stmmac_init_rx_buffers():
* add missing handling of dma_map_single() error
* remove superfluous unlikely() optimization while at it

Add stmmac_free_rx_buffers() helper and use it in dma_free_rx_skbufs().

In init_dma_desc_rings():
* add missing handling of kmalloc_array() errors
* fix handling of dma_alloc_coherent() and stmmac_init_rx_buffers() errors
* make function return an error value on error and 0 on success

In stmmac_open():
* add handling of init_dma_desc_rings() return value

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c