summaryrefslogtreecommitdiff
path: root/lib/kunit/executor_test.c
diff options
context:
space:
mode:
authorRae Moar <rmoar@google.com>2023-08-03 22:36:35 +0300
committerShuah Khan <skhan@linuxfoundation.org>2023-08-04 22:41:55 +0300
commit1c9fd080dffe5e5ad763527fbc2aa3f6f8c653e9 (patch)
tree383cad59d1916e6151319c99903b1dfb12132efb /lib/kunit/executor_test.c
parentabbf73816b6f5f4268fbfb3b3505003c2356d4a9 (diff)
downloadlinux-1c9fd080dffe5e5ad763527fbc2aa3f6f8c653e9.tar.xz
kunit: fix uninitialized variables bug in attributes filtering
Fix smatch warnings regarding uninitialized variables in the filtering patch of the new KUnit Attributes feature. Fixes: 529534e8cba3 ("kunit: Add ability to filter attributes") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/202307270610.s0w4NKEn-lkp@intel.com/ Signed-off-by: Rae Moar <rmoar@google.com> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'lib/kunit/executor_test.c')
-rw-r--r--lib/kunit/executor_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/kunit/executor_test.c b/lib/kunit/executor_test.c
index 01280cb8d451..3e0a1c99cb4e 100644
--- a/lib/kunit/executor_test.c
+++ b/lib/kunit/executor_test.c
@@ -119,7 +119,7 @@ static void parse_filter_attr_test(struct kunit *test)
filter_count = kunit_get_filter_count(filters);
KUNIT_EXPECT_EQ(test, filter_count, 2);
- parsed_filters = kunit_kcalloc(test, filter_count + 1, sizeof(*parsed_filters),
+ parsed_filters = kunit_kcalloc(test, filter_count, sizeof(*parsed_filters),
GFP_KERNEL);
for (j = 0; j < filter_count; j++) {
parsed_filters[j] = kunit_next_attr_filter(&filters, &err);