treewide: Use array_size() in vmalloc()
[linux-2.6-block.git] / drivers / mtd / nand / raw / nandsim.c
index e027c6f9d3275fc285ada7b2022ff64433f6724c..9dc29d4389f7ed9986abe1e13ff8bd40578ab1e8 100644 (file)
@@ -582,7 +582,7 @@ static int __init alloc_device(struct nandsim *ns)
                return 0;
        }
 
-       ns->pages = vmalloc(ns->geom.pgnum * sizeof(union ns_mem));
+       ns->pages = vmalloc(array_size(sizeof(union ns_mem), ns->geom.pgnum));
        if (!ns->pages) {
                NS_ERR("alloc_device: unable to allocate page array\n");
                return -ENOMEM;