efi: Small leak on error in runtime map code
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 15 Jan 2015 09:21:21 +0000 (12:21 +0300)
committerMatt Fleming <matt.fleming@intel.com>
Tue, 20 Jan 2015 15:50:25 +0000 (15:50 +0000)
The "> 0" here should ">= 0" so we free map_entries[0].

Fixes: 926172d46038 ('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>
drivers/firmware/efi/runtime-map.c

index 018c29a2661553004fc5639a71ef5af9de9849b2..87b8e3b900d2195bc44ae471003db4ad610b7d77 100644 (file)
@@ -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);
        }