From: Jesper Juhl Date: Fri, 31 Dec 2010 19:18:48 +0000 (-0800) Subject: Broadcom CNIC core network driver: fix mem leak on allocation failures in cnic_alloc_... X-Git-Tag: v2.6.37~1^2~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7e4c9775ea648deed4a8193951e50d0c7706173;p=pandora-kernel.git Broadcom CNIC core network driver: fix mem leak on allocation failures in cnic_alloc_uio_rings() We are leaking memory in drivers/net/cnic.c::cnic_alloc_uio_rings() if either of the calls to dma_alloc_coherent() fail. This patch fixes it by freeing both the memory allocated with kzalloc() and memory allocated with previous calls to dma_alloc_coherent() when there's a failure. Thanks to Joe Perches for suggesting a better implementation than my initial version. Signed-off-by: Jesper Juhl Acked-by: Michael Chan Signed-off-by: David S. Miller --- Reading git-diff-tree failed