treewide: Use array_size() in vzalloc()
[linux-block.git] / drivers / mtd / nand / raw / nandsim.c
index 9dc29d4389f7ed9986abe1e13ff8bd40578ab1e8..f8edacde49ab5e20370d0cbb283ffa850e1990ef 100644 (file)
@@ -565,8 +565,9 @@ static int __init alloc_device(struct nandsim *ns)
                        err = -EINVAL;
                        goto err_close;
                }
-               ns->pages_written = vzalloc(BITS_TO_LONGS(ns->geom.pgnum) *
-                                           sizeof(unsigned long));
+               ns->pages_written =
+                       vzalloc(array_size(sizeof(unsigned long),
+                                          BITS_TO_LONGS(ns->geom.pgnum)));
                if (!ns->pages_written) {
                        NS_ERR("alloc_device: unable to allocate pages written array\n");
                        err = -ENOMEM;