diff options
| author | 2010-12-31 11:18:48 -0800 | |
|---|---|---|
| committer | 2010-12-31 11:18:48 -0800 | |
| commit | f7e4c9775ea648deed4a8193951e50d0c7706173 (patch) | |
| tree | 552432919518946318a2fcec90365f4f5006cf8e /lib/flex_array.c | |
| parent | ISDN, Gigaset: Fix memory leak in do_disconnect_req() (diff) | |
| download | linux-dev-f7e4c9775ea648deed4a8193951e50d0c7706173.tar.xz linux-dev-f7e4c9775ea648deed4a8193951e50d0c7706173.zip | |
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 <joe@perches.com> for suggesting a better
implementation than my initial version.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/flex_array.c')
0 files changed, 0 insertions, 0 deletions
