treewide: Use array_size() in vzalloc()
[linux-block.git] / block / partitions / check.c
index 720145c49066ccd6e77449033aa3c6f910b7c2d5..ffe408fead0cdf8ca137be725540e35aa122572a 100644 (file)
@@ -122,7 +122,7 @@ static struct parsed_partitions *allocate_partitions(struct gendisk *hd)
                return NULL;
 
        nr = disk_max_parts(hd);
-       state->parts = vzalloc(nr * sizeof(state->parts[0]));
+       state->parts = vzalloc(array_size(nr, sizeof(state->parts[0])));
        if (!state->parts) {
                kfree(state);
                return NULL;