* [PATCH] drivers/platform/x86: Fix memory leak
@ 2011-06-03 18:55 Andre Bartke
0 siblings, 0 replies; only message in thread
From: Andre Bartke @ 2011-06-03 18:55 UTC (permalink / raw)
To: cezary.jackiewicz; +Cc: mjg, platform-driver-x86, linux-kernel, Andre Bartke
data is not freed in the error case of
compal_probe().
Signed-off-by: Andre Bartke <andre.bartke@gmail.com>
---
drivers/platform/x86/compal-laptop.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c
index 3f204fd..8877b83 100644
--- a/drivers/platform/x86/compal-laptop.c
+++ b/drivers/platform/x86/compal-laptop.c
@@ -1030,8 +1030,10 @@ static int __devinit compal_probe(struct platform_device *pdev)
initialize_fan_control_data(data);
err = sysfs_create_group(&pdev->dev.kobj, &compal_attribute_group);
- if (err)
+ if (err) {
+ kfree(data);
return err;
+ }
data->hwmon_dev = hwmon_device_register(&pdev->dev);
if (IS_ERR(data->hwmon_dev)) {
--
1.7.5.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-06-03 18:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-03 18:55 [PATCH] drivers/platform/x86: Fix memory leak Andre Bartke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).