aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2008-08-20 17:09:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-08-20 18:40:31 -0400
commita09f48551273ee89d4e9ae37474807dc2da1d757 (patch)
tree0d0e64ed51a40405b04926c66972c52afc723953 /drivers/char
parent27aa069a8850a36b8aef0160e73cfd928c6bbcc4 (diff)
drivers/char/ipmi/ipmi_si_intf.c:default_find_bmc(): fix leak
If check_legacy_ioport() returns true, we leak *info. Addresses http://bugzilla.kernel.org/show_bug.cgi?id=11362 Reported-by: Daniel Marjamki <danielm77@spray.se> Cc: Christian Krafft <krafft@de.ibm.com> Cc: Michael Ellerman <michael@ellerman.id.au> Cc: Corey Minyard <minyard@acm.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index f52931e1c16e..8e8afb6141f9 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -2695,15 +2695,13 @@ static __devinit void default_find_bmc(void)
2695 for (i = 0; ; i++) { 2695 for (i = 0; ; i++) {
2696 if (!ipmi_defaults[i].port) 2696 if (!ipmi_defaults[i].port)
2697 break; 2697 break;
2698
2699 info = kzalloc(sizeof(*info), GFP_KERNEL);
2700 if (!info)
2701 return;
2702
2703#ifdef CONFIG_PPC_MERGE 2698#ifdef CONFIG_PPC_MERGE
2704 if (check_legacy_ioport(ipmi_defaults[i].port)) 2699 if (check_legacy_ioport(ipmi_defaults[i].port))
2705 continue; 2700 continue;
2706#endif 2701#endif
2702 info = kzalloc(sizeof(*info), GFP_KERNEL);
2703 if (!info)
2704 return;
2707 2705
2708 info->addr_source = NULL; 2706 info->addr_source = NULL;
2709 2707