android_kernel_motorola_sm6225/drivers/message/fusion
Jesper Juhl 568761955a [SCSI] mpt fusion: fix two potential mem leaks
The Coverity checker spotted two potential memory leaks in
drivers/message/fusion/mptbase.c::mpt_attach().

There are two returns that may leak the storage allocated for 'ioc'
(sizeof(MPT_ADAPTER) bytes).

A simple fix would be to simply add two kfree() calls before the return
statements, but a better fix (that this patch implements) is to reorder the
code so that if we hit the first return condition we don't have to do the
allocation at all and then just add a kfree() call for the second case.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Acked-by: "Moore, Eric Dean" <Eric.Moore@lsil.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:47:13 -04:00
..
lsi [SCSI] mpt fusion: Change company name from LSI Logic to LSI 2007-10-12 14:40:54 -04:00
Kconfig [SCSI] mpt fusion: Use menuconfig objects 2007-10-12 14:47:05 -04:00
Makefile [SCSI] mpt fusion: logging support in Kconfig, Makefile, mptbase.h and addition of mptdebug.h 2007-07-28 11:25:35 -04:00
mptbase.c [SCSI] mpt fusion: fix two potential mem leaks 2007-10-12 14:47:13 -04:00
mptbase.h [SCSI] mpt fusion: Change company name from LSI Logic to LSI 2007-10-12 14:40:54 -04:00
mptctl.c [SCSI] mpt fusion: mostly kmalloc + memset conversion to kzalloc 2007-10-12 14:47:10 -04:00
mptctl.h [SCSI] mpt fusion: Change company name from LSI Logic to LSI 2007-10-12 14:40:54 -04:00
mptdebug.h [SCSI] mpt fusion: logging support in Kconfig, Makefile, mptbase.h and addition of mptdebug.h 2007-07-28 11:25:35 -04:00
mptfc.c [SCSI] mpt fusion: Change company name from LSI Logic to LSI 2007-10-12 14:40:54 -04:00
mptlan.c [SCSI] mpt fusion: Change company name from LSI Logic to LSI 2007-10-12 14:40:54 -04:00
mptlan.h [SCSI] mpt fusion: Change company name from LSI Logic to LSI 2007-10-12 14:40:54 -04:00
mptsas.c [SCSI] mpt fusion: Change company name from LSI Logic to LSI 2007-10-12 14:40:54 -04:00
mptsas.h [SCSI] mpt fusion: Creation of mptsas.h header file 2007-10-12 14:40:47 -04:00
mptscsih.c [SCSI] mpt fusion: Change company name from LSI Logic to LSI 2007-10-12 14:40:54 -04:00
mptscsih.h [SCSI] mpt fusion: Change company name from LSI Logic to LSI 2007-10-12 14:40:54 -04:00
mptspi.c [SCSI] mpt fusion: Change company name from LSI Logic to LSI 2007-10-12 14:40:54 -04:00