remarkable-linux/drivers/message
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
..
fusion [SCSI] mpt fusion: fix two potential mem leaks 2007-10-12 14:47:13 -04:00
i2o fix integer overflow warning in i2o_block 2007-07-31 15:39:44 -07:00
Makefile