[PATCH 04/15] vio: put device on device_register failure
Nishanth Aravamudan
nacc at us.ibm.com
Thu Sep 16 04:05:47 EST 2010
The kernel doc for device_register (and device_initialize) very clearly
state to call put_device not kfree after calling, even on error.
Signed-off-by: Milton Miller <miltonm at bga.com>
Signed-off-by: Nishanth Aravamudan <nacc at us.ibm.com>
---
arch/powerpc/kernel/vio.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index fa3469d..72db4b0 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1254,8 +1254,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
if (device_register(&viodev->dev)) {
printk(KERN_ERR "%s: failed to register device %s\n",
__func__, dev_name(&viodev->dev));
- /* XXX free TCE table */
- kfree(viodev);
+ put_device(&viodev->dev);
return NULL;
}
--
1.7.0.4
More information about the Linuxppc-dev
mailing list