projects
/
platform
/
kernel
/
linux-starfive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'DPAA-fixes'
[platform/kernel/linux-starfive.git]
/
lib
/
test_firmware.c
diff --git
a/lib/test_firmware.c
b/lib/test_firmware.c
index
cee000a
..
b984806
100644
(file)
--- a/
lib/test_firmware.c
+++ b/
lib/test_firmware.c
@@
-618,8
+618,9
@@
static ssize_t trigger_batched_requests_store(struct device *dev,
mutex_lock(&test_fw_mutex);
mutex_lock(&test_fw_mutex);
- test_fw_config->reqs = vzalloc(sizeof(struct test_batched_req) *
- test_fw_config->num_requests * 2);
+ test_fw_config->reqs =
+ vzalloc(array3_size(sizeof(struct test_batched_req),
+ test_fw_config->num_requests, 2));
if (!test_fw_config->reqs) {
rc = -ENOMEM;
goto out_unlock;
if (!test_fw_config->reqs) {
rc = -ENOMEM;
goto out_unlock;
@@
-720,8
+721,9
@@
ssize_t trigger_batched_requests_async_store(struct device *dev,
mutex_lock(&test_fw_mutex);
mutex_lock(&test_fw_mutex);
- test_fw_config->reqs = vzalloc(sizeof(struct test_batched_req) *
- test_fw_config->num_requests * 2);
+ test_fw_config->reqs =
+ vzalloc(array3_size(sizeof(struct test_batched_req),
+ test_fw_config->num_requests, 2));
if (!test_fw_config->reqs) {
rc = -ENOMEM;
goto out;
if (!test_fw_config->reqs) {
rc = -ENOMEM;
goto out;