public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][IPMI] Fix mem leak in try_init_dmi() code
@ 2007-07-18 22:57 Jesper Juhl
  2007-07-19 14:18 ` Corey Minyard
  0 siblings, 1 reply; 2+ messages in thread
From: Jesper Juhl @ 2007-07-18 22:57 UTC (permalink / raw)
  To: Corey Minyard
  Cc: Christian Krafft, openipmi-developer, minyard,
	Linux Kernel Mailing List, Jesper Juhl

Hi there,

If we ever hit the "default:" case in the switch in try_init_dmi(), 
then we'll leak the storage allocated with kzalloc() and assigned 
to 'info'. 

Note: patch has been compile tested only.

Please consider merging upstream :-)


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 drivers/char/ipmi/ipmi_si_intf.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_si_intf.c 
b/drivers/char/ipmi/ipmi_si_intf.c
index 4edfdda..96d2f9e 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -2050,6 +2050,7 @@ static __devinit void try_init_dmi(struct dmi_ipmi_data 
*ipmi_data)
 		info->si_type = SI_BT;
 		break;
 	default:
+		kfree(info);
 		return;
 	}
 



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-19 14:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-18 22:57 [PATCH][IPMI] Fix mem leak in try_init_dmi() code Jesper Juhl
2007-07-19 14:18 ` Corey Minyard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox