From: Heinz Mauelshagen <heinzm@xxxxxxxxxx> Signed-off-by: heinzm <heinzm@xxxxxxxxxx> --- drivers/md/md.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 9b734720b9c1..3d17773e058f 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -164,8 +164,7 @@ static int rdev_init_serial(struct md_rdev *rdev) if (test_bit(CollisionCheck, &rdev->flags)) return 0; - serial = kvmalloc(sizeof(struct serial_in_rdev) * serial_nums, - GFP_KERNEL); + serial = kvmalloc_array(serial_nums, sizeof(struct serial_in_rdev), GFP_KERNEL); if (!serial) return -ENOMEM; -- 2.39.2