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.pieral...@arm.com>
---
 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

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

Reply via email to