Skip to content

Commit

Permalink
drivers/char/ipmi/ipmi_si_intf.c:default_find_bmc(): fix leak
Browse files Browse the repository at this point in the history
If check_legacy_ioport() returns true, we leak *info.

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=11362

Reported-by: Daniel Marjamki <[email protected]>
Cc: Christian Krafft <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Corey Minyard <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
akpm00 authored and torvalds committed Aug 20, 2008
1 parent 27aa069 commit a09f485
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/char/ipmi/ipmi_si_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2695,15 +2695,13 @@ static __devinit void default_find_bmc(void)
for (i = 0; ; i++) {
if (!ipmi_defaults[i].port)
break;

info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info)
return;

#ifdef CONFIG_PPC_MERGE
if (check_legacy_ioport(ipmi_defaults[i].port))
continue;
#endif
info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info)
return;

info->addr_source = NULL;

Expand Down

0 comments on commit a09f485

Please sign in to comment.