Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / drivers / irqchip / qcom-irq-combiner.c
index 067337ab3f20fa4da2b0b1ae0a6ffa779e09c874..d88e993aa66de64363cd379346aa801ba1dd853f 100644 (file)
@@ -229,7 +229,6 @@ static int get_registers(struct platform_device *pdev, struct combiner *comb)
 static int __init combiner_probe(struct platform_device *pdev)
 {
        struct combiner *combiner;
-       size_t alloc_sz;
        int nregs;
        int err;
 
@@ -239,8 +238,8 @@ static int __init combiner_probe(struct platform_device *pdev)
                return -EINVAL;
        }
 
-       alloc_sz = sizeof(*combiner) + sizeof(struct combiner_reg) * nregs;
-       combiner = devm_kzalloc(&pdev->dev, alloc_sz, GFP_KERNEL);
+       combiner = devm_kzalloc(&pdev->dev, struct_size(combiner, regs, nregs),
+                               GFP_KERNEL);
        if (!combiner)
                return -ENOMEM;