Commit 89639edd authored by Dan Carpenter's avatar Dan Carpenter Committed by Luis Henriques

efi: Small leak on error in runtime map code

commit 86d68a58 upstream.

The "> 0" here should ">= 0" so we free map_entries[0].

Fixes: 926172d4 ('efi: Export EFI runtime memory mapping to sysfs')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarDave Young <dyoung@redhat.com>
Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 62503026
......@@ -170,7 +170,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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment