aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Lei <tom.leiming@gmail.com>2009-04-23 10:31:52 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-16 00:30:24 -0400
commit6acf70f078ca42a63397b8b84bf6383b01303009 (patch)
tree73b5b8264cd7663c807edabcf8545151f43f0386
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>
-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 8a267c427629..2d296b7f7034 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)
356 __free_page(fw_priv->pages[i]); 356 __free_page(fw_priv->pages[i]);
357 kfree(fw_priv->pages); 357 kfree(fw_priv->pages);
358 kfree(fw_priv); 358 kfree(fw_priv);
359 kfree(dev); 359 put_device(dev);
360 360
361 module_put(THIS_MODULE); 361 module_put(THIS_MODULE);
362} 362}
@@ -400,14 +400,16 @@ static int fw_register_device(struct device **dev_p, const char *fw_name,
400 retval = device_register(f_dev); 400 retval = device_register(f_dev);
401 if (retval) { 401 if (retval) {
402 dev_err(device, "%s: device_register failed\n", __func__); 402 dev_err(device, "%s: device_register failed\n", __func__);
403 goto error_kfree; 403 put_device(f_dev);
404 goto error_kfree1;
404 } 405 }
405 *dev_p = f_dev; 406 *dev_p = f_dev;
406 return 0; 407 return 0;
407 408
408error_kfree: 409error_kfree:
409 kfree(fw_priv);
410 kfree(f_dev); 410 kfree(f_dev);
411error_kfree1:
412 kfree(fw_priv);
411 return retval; 413 return retval;
412} 414}
413 415