kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] efi: small leak on error
@ 2015-01-15  9:21 Dan Carpenter
  2015-01-15  9:54 ` Dave Young
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dan Carpenter @ 2015-01-15  9:21 UTC (permalink / raw)
  To: Matt Fleming, Dave Young; +Cc: linux-efi, kernel-janitors

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>

diff --git a/drivers/firmware/efi/runtime-map.c b/drivers/firmware/efi/runtime-map.c
index 018c29a..87b8e3b 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);
 	}

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-01-20 15:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-15  9:21 [patch] efi: small leak on error Dan Carpenter
2015-01-15  9:54 ` Dave Young
     [not found]   ` <20150115095455.GA15197-4/PLUo9XfK/1wF9wiOj0lkEOCMrvLtNR@public.gmane.org>
2015-01-15 10:28     ` Dan Carpenter
2015-01-15 12:22       ` Dave Young
2015-01-15 12:24 ` Dave Young
2015-01-20 15:59 ` Matt Fleming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).