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: 529534e8cb ("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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user