mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-06 05:13:18 +00:00
kunit: Fix the wrong kfree of copy for kunit_filter_suites()
If the outer layer for loop is iterated more than once and it fails not
in the first iteration, the copy pointer has been moved. So it should free
the original copy's backup copy_start.
Fixes: abbf73816b
("kunit: fix possible memory leak in kunit_filter_suites()")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-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:
parent
a6074cf012
commit
e44679515a
@ -243,7 +243,7 @@ kunit_filter_suites(const struct kunit_suite_set *suite_set,
|
||||
|
||||
free_copy:
|
||||
if (*err)
|
||||
kfree(copy);
|
||||
kfree(copy_start);
|
||||
|
||||
return filtered;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user