* [patch] efi: remove "kfree(NULL)"
@ 2013-04-30 7:43 Dan Carpenter
[not found] ` <20130430074344.GE7237-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-04-30 7:43 UTC (permalink / raw)
To: Matt Fleming
Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA,
kernel-janitors-u79uwXL29TY76Z2rM5mHXA
No need to free a NULL pointer.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/firmware/efi/efivars.c b/drivers/firmware/efi/efivars.c
index 66928a3..7067b56 100644
--- a/drivers/firmware/efi/efivars.c
+++ b/drivers/firmware/efi/efivars.c
@@ -420,10 +420,8 @@ efivar_create_sysfs_entry(struct efivar_entry *new_var)
short_name = kzalloc(short_name_size, GFP_KERNEL);
- if (!short_name) {
- kfree(short_name);
+ if (!short_name)
return 1;
- }
/* Convert Unicode to normal chars (assume top bits are 0),
ala UTF-8 */
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-04-30 11:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-30 7:43 [patch] efi: remove "kfree(NULL)" Dan Carpenter
[not found] ` <20130430074344.GE7237-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
2013-04-30 11:34 ` Matt Fleming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox