public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 1/2] efivars: memory leak on error in create_efivars_bin_attributes()
@ 2011-03-18  7:12 Dan Carpenter
  2011-03-18  9:23 ` Mike Waychison
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-03-18  7:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mike Waychison, Chris Wright, Tejun Heo, linux-kernel,
	kernel-janitors

This is a cut and paste bug.  We intended to free ->del_var and
->new_var but we only free ->new_var.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index ff0c373..ff2fe40 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -677,8 +677,8 @@ create_efivars_bin_attributes(struct efivars *efivars)
 
 	return 0;
 out_free:
-	kfree(efivars->new_var);
-	efivars->new_var = NULL;
+	kfree(efivars->del_var);
+	efivars->del_var = NULL;
 	kfree(efivars->new_var);
 	efivars->new_var = NULL;
 	return error;

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

* Re: [patch 1/2] efivars: memory leak on error in create_efivars_bin_attributes()
  2011-03-18  7:12 [patch 1/2] efivars: memory leak on error in create_efivars_bin_attributes() Dan Carpenter
@ 2011-03-18  9:23 ` Mike Waychison
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Waychison @ 2011-03-18  9:23 UTC (permalink / raw)
  To: Dan Carpenter, Greg Kroah-Hartman, Mike Waychison, Chris Wright,
	Tejun Heo, linux-kernel, kernel-janitors

On Fri, Mar 18, 2011 at 12:12 AM, Dan Carpenter <error27@gmail.com> wrote:
> This is a cut and paste bug.  We intended to free ->del_var and
> ->new_var but we only free ->new_var.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Acked-by: Mike Waychison <mikew@google.com>

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

end of thread, other threads:[~2011-03-18  9:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-18  7:12 [patch 1/2] efivars: memory leak on error in create_efivars_bin_attributes() Dan Carpenter
2011-03-18  9:23 ` Mike Waychison

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