summaryrefslogtreecommitdiffstats
path: root/lib/test_firmware.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/test_firmware.c')
-rw-r--r--lib/test_firmware.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/test_firmware.c b/lib/test_firmware.c
index cee000ac54d8..b984806d7d7b 100644
--- a/lib/test_firmware.c
+++ b/lib/test_firmware.c
@@ -618,8 +618,9 @@ static ssize_t trigger_batched_requests_store(struct device *dev,
618 618
619 mutex_lock(&test_fw_mutex); 619 mutex_lock(&test_fw_mutex);
620 620
621 test_fw_config->reqs = vzalloc(sizeof(struct test_batched_req) * 621 test_fw_config->reqs =
622 test_fw_config->num_requests * 2); 622 vzalloc(array3_size(sizeof(struct test_batched_req),
623 test_fw_config->num_requests, 2));
623 if (!test_fw_config->reqs) { 624 if (!test_fw_config->reqs) {
624 rc = -ENOMEM; 625 rc = -ENOMEM;
625 goto out_unlock; 626 goto out_unlock;
@@ -720,8 +721,9 @@ ssize_t trigger_batched_requests_async_store(struct device *dev,
720 721
721 mutex_lock(&test_fw_mutex); 722 mutex_lock(&test_fw_mutex);
722 723
723 test_fw_config->reqs = vzalloc(sizeof(struct test_batched_req) * 724 test_fw_config->reqs =
724 test_fw_config->num_requests * 2); 725 vzalloc(array3_size(sizeof(struct test_batched_req),
726 test_fw_config->num_requests, 2));
725 if (!test_fw_config->reqs) { 727 if (!test_fw_config->reqs) {
726 rc = -ENOMEM; 728 rc = -ENOMEM;
727 goto out; 729 goto out;