Skip to content

Commit

Permalink
efi: Small leak on error in runtime map code
Browse files Browse the repository at this point in the history
The "> 0" here should ">= 0" so we free map_entries[0].

Fixes: 926172d ('efi: Export EFI runtime memory mapping to sysfs')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
  • Loading branch information
Dan Carpenter authored and Matt Fleming committed Jan 20, 2015
1 parent 822a027 commit 86d68a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/firmware/efi/runtime-map.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ int __init efi_runtime_map_init(struct kobject *efi_kobj)

return 0;
out_add_entry:
for (j = i - 1; j > 0; j--) {
for (j = i - 1; j >= 0; j--) {
entry = *(map_entries + j);
kobject_put(&entry->kobj);
}
Expand Down

0 comments on commit 86d68a5

Please sign in to comment.