[patch 1/2] efivars: memory leak on error increate_efivars_bin_attributes()

From: Dan Carpenter
Date: Fri Mar 18 2011 - 03:12:37 EST

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@xxxxxxxxx>

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;
- kfree(efivars->new_var);
- efivars->new_var = NULL;
+ kfree(efivars->del_var);
+ efivars->del_var = NULL;
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/