From: Axel Lin Date: Thu, 1 Jul 2010 02:35:07 +0000 (+0800) Subject: dmi-id: fix a memory leak in dmi_id_init error path X-Git-Tag: v3.0~4100^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5b232f753a842fa66eab86e51dc76e3929d853af;p=platform%2Fkernel%2Flinux-amlogic.git dmi-id: fix a memory leak in dmi_id_init error path This patch adds a missing kfree(dmi_dev) in dmi_id_init error path. Signed-off-by: Axel Lin Acked-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c index a777a35..94a58a0 100644 --- a/drivers/firmware/dmi-id.c +++ b/drivers/firmware/dmi-id.c @@ -229,10 +229,12 @@ static int __init dmi_id_init(void) ret = device_register(dmi_dev); if (ret) - goto fail_class_unregister; + goto fail_free_dmi_dev; return 0; +fail_free_dmi_dev: + kfree(dmi_dev); fail_class_unregister: class_unregister(&dmi_class);