[RFC PATCH 01/14] ARM: amba device memory allocation fix

Grant Likely grant.likely at secretlab.ca
Thu Aug 19 05:24:04 EST 2010


On Wed, Aug 18, 2010 at 12:59 PM, Lorenzo Pieralisi
<lorenzo.pieralisi at arm.com> wrote:
> When instantiating amba devices dynamically from device tree nodes, the
> memory allocation should be carried out using the kzalloc function to make
> sure all the members are zero initialized.
>
> This patch replaces the kmalloc call with a kzalloc one.
>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi at arm.com>

Fixed in my tree.  You'll be able to drop this one when you rebase.

g.

> ---
>  drivers/amba/bus.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
> index d73302c..234f4a3 100644
> --- a/drivers/amba/bus.c
> +++ b/drivers/amba/bus.c
> @@ -421,7 +421,7 @@ static int amba_add_device_from_node(struct device_node *node)
>        const char *name;
>        int i, ret, len;
>
> -       dev = kmalloc(sizeof(*dev), GFP_KERNEL);
> +       dev = kzalloc(sizeof(*dev), GFP_KERNEL);
>        if (!dev)
>                return -ENOMEM;
>
> --
> 1.6.3.3
>
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.


More information about the devicetree-discuss mailing list