From: Dan Carpenter Date: Fri, 18 Mar 2011 07:12:14 +0000 (+0300) Subject: efivars: memory leak on error in create_efivars_bin_attributes() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=051d51bc6a867d9466a975e4d7ca51b21a9c2c4e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Acked-by: Mike Waychison Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index ff0c373e3bbf..ff2fe4095228 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;