[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110318071214.GV2008@bicker>
Date: Fri, 18 Mar 2011 10:12:14 +0300
From: Dan Carpenter <error27@...il.com>
To: Greg Kroah-Hartman <gregkh@...e.de>
Cc: Mike Waychison <mikew@...gle.com>,
Chris Wright <chrisw@...s-sol.org>, Tejun Heo <tj@...nel.org>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [patch 1/2] efivars: memory leak on error in
create_efivars_bin_attributes()
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@...il.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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists