diff options
author | Axel Lin <axel.lin@gmail.com> | 2010-06-30 22:35:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-05 16:53:34 -0400 |
commit | 5b232f753a842fa66eab86e51dc76e3929d853af (patch) | |
tree | d12dc476ed350e9fb6a0974a5c7126ef58a5d6a1 /drivers/firmware/dmi-id.c | |
parent | 49c19400f60bbe362202d7e7b3e68cc66040d0fa (diff) |
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 <axel.lin@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/firmware/dmi-id.c')
-rw-r--r-- | drivers/firmware/dmi-id.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c index a777a35381d2..94a58a082b99 100644 --- a/drivers/firmware/dmi-id.c +++ b/drivers/firmware/dmi-id.c | |||
@@ -229,10 +229,12 @@ static int __init dmi_id_init(void) | |||
229 | 229 | ||
230 | ret = device_register(dmi_dev); | 230 | ret = device_register(dmi_dev); |
231 | if (ret) | 231 | if (ret) |
232 | goto fail_class_unregister; | 232 | goto fail_free_dmi_dev; |
233 | 233 | ||
234 | return 0; | 234 | return 0; |
235 | 235 | ||
236 | fail_free_dmi_dev: | ||
237 | kfree(dmi_dev); | ||
236 | fail_class_unregister: | 238 | fail_class_unregister: |
237 | 239 | ||
238 | class_unregister(&dmi_class); | 240 | class_unregister(&dmi_class); |