projects
/
linux-2.6-block.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
treewide: Use array_size() in vmalloc()
[linux-2.6-block.git]
/
drivers
/
mtd
/
nand
/
raw
/
nandsim.c
diff --git
a/drivers/mtd/nand/raw/nandsim.c
b/drivers/mtd/nand/raw/nandsim.c
index e027c6f9d3275fc285ada7b2022ff64433f6724c..9dc29d4389f7ed9986abe1e13ff8bd40578ab1e8 100644
(file)
--- a/
drivers/mtd/nand/raw/nandsim.c
+++ b/
drivers/mtd/nand/raw/nandsim.c
@@
-582,7
+582,7
@@
static int __init alloc_device(struct nandsim *ns)
return 0;
}
- ns->pages = vmalloc(
ns->geom.pgnum * sizeof(union ns_me
m));
+ ns->pages = vmalloc(
array_size(sizeof(union ns_mem), ns->geom.pgnu
m));
if (!ns->pages) {
NS_ERR("alloc_device: unable to allocate page array\n");
return -ENOMEM;