diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-01-15 04:21:21 -0500 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2015-01-20 10:50:25 -0500 |
commit | 86d68a58d00db3770735b5919ef2c6b12d7f06f3 (patch) | |
tree | 86c44e08c0682d84147ce93a82efc86fee8d014b /drivers/firmware | |
parent | 822a0279287603f150b991d0ea319bbba5aa235a (diff) |
efi: Small leak on error in runtime map code
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>
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/efi/runtime-map.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/firmware/efi/runtime-map.c b/drivers/firmware/efi/runtime-map.c index 018c29a26615..87b8e3b900d2 100644 --- a/drivers/firmware/efi/runtime-map.c +++ b/drivers/firmware/efi/runtime-map.c | |||
@@ -191,7 +191,7 @@ int __init efi_runtime_map_init(struct kobject *efi_kobj) | |||
191 | 191 | ||
192 | return 0; | 192 | return 0; |
193 | out_add_entry: | 193 | out_add_entry: |
194 | for (j = i - 1; j > 0; j--) { | 194 | for (j = i - 1; j >= 0; j--) { |
195 | entry = *(map_entries + j); | 195 | entry = *(map_entries + j); |
196 | kobject_put(&entry->kobj); | 196 | kobject_put(&entry->kobj); |
197 | } | 197 | } |