From: Jeff Garzik Date: Wed, 11 Oct 2006 08:22:23 +0000 (-0700) Subject: [PATCH] firmware/efivars: handle error X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=69b2186c5fcb335e29c558e3b4e410e1939b5cc8;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [PATCH] firmware/efivars: handle error Signed-off-by: Jeff Garzik Acked-by: Matt Domsch Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 8ebce1c03ad7..5ab5e393b882 100644 --- a/drivers/firmware/efivars.c +++ b/drivers/firmware/efivars.c @@ -639,7 +639,12 @@ efivar_create_sysfs_entry(unsigned long variable_name_size, kobject_set_name(&new_efivar->kobj, "%s", short_name); kobj_set_kset_s(new_efivar, vars_subsys); - kobject_register(&new_efivar->kobj); + i = kobject_register(&new_efivar->kobj); + if (i) { + kfree(short_name); + kfree(new_efivar); + return 1; + } kfree(short_name); short_name = NULL;