From: Dan Carpenter Date: Thu, 5 Feb 2015 08:00:42 +0000 (+0300) Subject: net: sxgbe: fix error handling in init_rx_ring() X-Git-Tag: omap-for-v4.1/prcm-dts-mfd-syscon-fix~134^2~3^2~11 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37c85c3498c5538db050ff287e346127dbc16f7c;p=pandora-kernel.git 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 Signed-off-by: David S. Miller --- Reading git-diff-tree failed