[PATCH 04/15] vio: put device on device_register failure
Grant Likely
grant.likely at secretlab.ca
Thu Sep 16 04:29:52 EST 2010
On Wed, Sep 15, 2010 at 12:05 PM, Nishanth Aravamudan <nacc at us.ibm.com> wrote:
> 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>
Acked-by: Grant Likely <grant.likely at secretlab.ca>
> ---
> 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
>
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
More information about the Linuxppc-dev
mailing list