diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-01-15 12:21:21 +0300 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-03-24 04:02:50 +0300 |
commit | f3b9a854c406ce44342bca393930a429cdb6d241 (patch) | |
tree | ede4c57e5d453a7baadf837efe85fd8d9750a971 /drivers/firmware | |
parent | 95379cd7dae4b6e8490dab8c208b5537685cbeff (diff) | |
download | linux-f3b9a854c406ce44342bca393930a429cdb6d241.tar.xz |
efi: Small leak on error in runtime map code
commit 86d68a58d00db3770735b5919ef2c6b12d7f06f3 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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) 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); } |