summaryrefslogtreecommitdiff
path: root/lib/kunit/executor.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kunit/executor.c')
-rw-r--r--lib/kunit/executor.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/kunit/executor.c b/lib/kunit/executor.c
index 02ff380ab793..27740d975082 100644
--- a/lib/kunit/executor.c
+++ b/lib/kunit/executor.c
@@ -131,7 +131,7 @@ kunit_filter_glob_tests(const struct kunit_suite *const suite, const char *test_
if (!copy)
return ERR_PTR(-ENOMEM);
- filtered = kcalloc(n + 1, sizeof(*filtered), GFP_KERNEL);
+ filtered = kzalloc_objs(*filtered, n + 1, GFP_KERNEL);
if (!filtered) {
kfree(copy);
return ERR_PTR(-ENOMEM);
@@ -179,7 +179,7 @@ kunit_filter_suites(const struct kunit_suite_set *suite_set,
const size_t max = suite_set->end - suite_set->start;
- copy = kcalloc(max, sizeof(*copy), GFP_KERNEL);
+ copy = kzalloc_objs(*copy, max, GFP_KERNEL);
if (!copy) { /* won't be able to run anything, return an empty set */
return filtered;
}
@@ -194,7 +194,8 @@ kunit_filter_suites(const struct kunit_suite_set *suite_set,
/* Parse attribute filters */
if (filters) {
filter_count = kunit_get_filter_count(filters);
- parsed_filters = kcalloc(filter_count, sizeof(*parsed_filters), GFP_KERNEL);
+ parsed_filters = kzalloc_objs(*parsed_filters, filter_count,
+ GFP_KERNEL);
if (!parsed_filters) {
*err = -ENOMEM;
goto free_parsed_glob;