diff options
author | Nishanth Aravamudan <nacc@us.ibm.com> | 2010-09-15 04:05:47 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-10-13 01:19:21 -0400 |
commit | edea8f6f48416d9a6fd1babb76c19cf05c802325 (patch) | |
tree | 07e531b594c3493206d119fd068aa2e5f902e97c /arch | |
parent | ffa56e555a6e4c205e879636e6cd6104ce03421f (diff) |
powerpc/vio: Use put_device() on device_register failure
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@bga.com>
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | 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 fa3469ddaef8..72db4b021762 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) | |||
1254 | if (device_register(&viodev->dev)) { | 1254 | if (device_register(&viodev->dev)) { |
1255 | printk(KERN_ERR "%s: failed to register device %s\n", | 1255 | printk(KERN_ERR "%s: failed to register device %s\n", |
1256 | __func__, dev_name(&viodev->dev)); | 1256 | __func__, dev_name(&viodev->dev)); |
1257 | /* XXX free TCE table */ | 1257 | put_device(&viodev->dev); |
1258 | kfree(viodev); | ||
1259 | return NULL; | 1258 | return NULL; |
1260 | } | 1259 | } |
1261 | 1260 | ||