]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
net: sxgbe: fix error handling in init_rx_ring()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 5 Feb 2015 08:00:42 +0000 (11:00 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Feb 2015 20:50:12 +0000 (12:50 -0800)
commit37c85c3498c5538db050ff287e346127dbc16f7c
tree8c1bbc4e4009c703b1cf7a1a8d6fa0cec59df007
parente8a308affcd79d95dad111f7872e43e9f73abb3b
net: sxgbe: fix error handling in init_rx_ring()

There are a couple bugs with the error handling in this function.

1) If we can't allocate "rx_ring->rx_skbuff" then we should call
   dma_free_coherent() but we don't.
2) free_rx_ring() frees "rx_ring->rx_skbuff_dma" and "rx_ring->rx_skbuff"
   so calling it in a loop causes a double free.

Also it was a bit confusing how we sometimes freed things before doing
the goto.  I've cleaned it up so it does error handling in normal kernel
style.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c