dmi-id: fix a memory leak in dmi_id_init error path
PATCH 1/1 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.
--- drivers/firmware/dmi-id.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/firmware/dmi-id.c +3 -1
@@ -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);
Signature · 1 line
1.5.4.3
Hello,
Quoted 3 lines · Axel Lin
This patch adds a missing
kfree(dmi_dev)indmi_id_initerror path.Signed-off-by Axel Lin <[email protected]>
Greg, can you please route this through device tree?
Thanks.
Signature · 1 line
tejun
Quoted 10 lines · Tejun Heo
Hello,
Quoted 3 lines · Axel Lin
This patch adds a missing
kfree(dmi_dev)indmi_id_initerror path.Signed-off-by Axel Lin <[email protected]>Acked-by Tejun Heo <[email protected]>Greg, can you please route this through device tree?
I will do that, thanks.
greg k-h
[email protected]
Appliedpatch "dmi-id: fix a memory leak in dmi_id_init error path" added to gregkh-2.6 tree
In reply to Axel LinThis is a note to let you know that I've just added the patch titled
dmi-id: fix a memory leak in dmi_id_init error path
to my gregkh-2.6 tree which can be found in directory form at:
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/
and in git form at:
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/patches.git
The filename of this patch is:
dmi-id-fix-a-memory-leak-in-dmi_id_init-error-path.patch
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
If this patch meets the merge guidelines for a bugfix, it should be merged into Linus's tree before the next major kernel release. If not, it will be merged into Linus's tree during the next merge window.
Either way, you will probably be copied on the patch when it gets sent to Linus for merging so that others can see what is happening in kernel development.
If you have any questions about this process, please let me know.
Quoted 1 line
From [email protected] Thu Jul 8 08:56:03 2010
From: Axel Lin <[email protected]>
Date: Thu, 01 Jul 2010 10:35:07 +0800
Subject: dmi-id: fix a memory leak in dmi_id_init error path
To: linux-kernel <[email protected]>
Cc: Tejun Heo <[email protected]>, David Brownell <[email protected]>, Greg Kroah-Hartman <[email protected]>
Message-ID: <1277951707.30073.5.camel@mola>
This patch adds a missing kfree(dmi_dev) in dmi_id_init error path.
--- drivers/firmware/dmi-id.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/firmware/dmi-id.c +3 -1
@@ -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);