aboutsummaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorMing Lei <tom.leiming@gmail.com>2009-04-23 22:31:52 +0800
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-15 21:30:24 -0700
commit6acf70f078ca42a63397b8b84bf6383b01303009 (patch)
tree73b5b8264cd7663c807edabcf8545151f43f0386 /drivers/base
parent557411eb2ce61ef5e87bd759a6f86881586df857 (diff)
driver core: firmware_class: replace kfree(dev) with put_device(dev)
against v2.6.30-rc3-next tree. Signed-off-by: Ming Lei <tom.leiming@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/firmware_class.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 8a267c42762..2d296b7f703 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -356,7 +356,7 @@ static void fw_dev_release(struct device *dev)
__free_page(fw_priv->pages[i]);
kfree(fw_priv->pages);
kfree(fw_priv);
- kfree(dev);
+ put_device(dev);
module_put(THIS_MODULE);
}
@@ -400,14 +400,16 @@ static int fw_register_device(struct device **dev_p, const char *fw_name,
retval = device_register(f_dev);
if (retval) {
dev_err(device, "%s: device_register failed\n", __func__);
- goto error_kfree;
+ put_device(f_dev);
+ goto error_kfree1;
}
*dev_p = f_dev;
return 0;
error_kfree:
- kfree(fw_priv);
kfree(f_dev);
+error_kfree1:
+ kfree(fw_priv);
return retval;
}