Merge tag 'drm-misc-fixes-2018-11-14' of git://anongit.freedesktop.org/drm/drm-misc...
[linux-2.6-block.git] / lib / test_kmod.c
index 0e5b7a61460bb092226a3785abeaa2168d95d790..e3ddd836491faef2a21c1b1218d4fd1c4b219f0f 100644 (file)
@@ -779,8 +779,9 @@ static int kmod_config_sync_info(struct kmod_test_device *test_dev)
        struct test_config *config = &test_dev->config;
 
        free_test_dev_info(test_dev);
-       test_dev->info = vzalloc(config->num_threads *
-                                sizeof(struct kmod_test_device_info));
+       test_dev->info =
+               vzalloc(array_size(sizeof(struct kmod_test_device_info),
+                                  config->num_threads));
        if (!test_dev->info)
                return -ENOMEM;