treewide: Use array_size() in vmalloc()
[linux-2.6-block.git] / drivers / md / dm-switch.c
index 7924a6a33ddcf1c8f3902a634a11b62421495213..fae35caf367208ab22cbe6900010ee353f52d666 100644 (file)
@@ -114,7 +114,8 @@ static int alloc_region_table(struct dm_target *ti, unsigned nr_paths)
                return -EINVAL;
        }
 
-       sctx->region_table = vmalloc(nr_slots * sizeof(region_table_slot_t));
+       sctx->region_table = vmalloc(array_size(nr_slots,
+                                               sizeof(region_table_slot_t)));
        if (!sctx->region_table) {
                ti->error = "Cannot allocate region table";
                return -ENOMEM;