]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/md/dm-cache-policy-smq.c
treewide: Use array_size() in vmalloc()
[linux.git] / drivers / md / dm-cache-policy-smq.c
index 4ab23d0075f615f35b9c996ae658a26456313465..4d69b6f4129e9ec7bd7cac7280dc03fa83552f60 100644 (file)
@@ -588,7 +588,7 @@ static int h_init(struct smq_hash_table *ht, struct entry_space *es, unsigned nr
        nr_buckets = roundup_pow_of_two(max(nr_entries / 4u, 16u));
        ht->hash_bits = __ffs(nr_buckets);
 
-       ht->buckets = vmalloc(sizeof(*ht->buckets) * nr_buckets);
+       ht->buckets = vmalloc(array_size(nr_buckets, sizeof(*ht->buckets)));
        if (!ht->buckets)
                return -ENOMEM;