Merge tag 'overflow-v4.18-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-block.git] / drivers / of / platform.c
index 59731a950c1f01262c2820c7f7f82f334b0f4762..6925d993e1f0f41b4894303fe77b3cf29729f595 100644 (file)
@@ -129,7 +129,7 @@ struct platform_device *of_device_alloc(struct device_node *np,
 
        /* Populate the resource table */
        if (num_irq || num_reg) {
-               res = kzalloc(sizeof(*res) * (num_irq + num_reg), GFP_KERNEL);
+               res = kcalloc(num_irq + num_reg, sizeof(*res), GFP_KERNEL);
                if (!res) {
                        platform_device_put(dev);
                        return NULL;