From: Jesper Juhl Date: Fri, 10 Aug 2007 21:50:51 +0000 (-0700) Subject: [SCSI] mpt fusion: fix two potential mem leaks X-Git-Tag: v2.6.24-rc1~1290^2~135 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=568761955ad01c6d238d8b12d21a554c1226a37b;p=pandora-kernel.git [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 Acked-by: "Moore, Eric Dean" Signed-off-by: Andrew Morton Signed-off-by: James Bottomley --- Reading git-diff-tree failed