Skip to content

Commit

Permalink
efivars: memory leak on error in create_efivars_bin_attributes()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Apr 19, 2011
1 parent bcdd323 commit 051d51b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/firmware/efivars.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 051d51b

Please sign in to comment.