public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
To: Jesper Juhl <jesper.juhl@gmail.com>, Andrew Morton <akpm@osdl.org>
Cc: Corey Minyard <minyard@mvista.com>,
	Christian Krafft <krafft@de.ibm.com>,
	openipmi-developer@lists.sourceforge.net,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][IPMI] Fix mem leak in try_init_dmi() code
Date: Thu, 19 Jul 2007 09:18:30 -0500	[thread overview]
Message-ID: <20070719141830.GA4757@minyard.local> (raw)
In-Reply-To: <200707190057.16051.jesper.juhl@gmail.com>

Indeed this is a problem, please merge.  This is only called at init
time and only happens if the BIOS screws something up, so the leak is
slight and it is probably not worth sending to 2.6.22.x.  The driver
would not initialize the interface in the case, and I have no reports
of this happening.  I have booted and run tests on a system with this
patch.  Note that the original patch was munged by the mailer, here's
a new one.


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'. 

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Corey Minyard <cminyard@mvista.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;
 	}
 

      reply	other threads:[~2007-07-19 14:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070719141830.GA4757@minyard.local \
    --to=minyard@acm.org \
    --cc=akpm@osdl.org \
    --cc=jesper.juhl@gmail.com \
    --cc=krafft@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minyard@mvista.com \
    --cc=openipmi-developer@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox