Skip to content
Commit 4b00920d authored by Jinjie Ruan's avatar Jinjie Ruan Committed by Shuah Khan
Browse files

kunit: Fix the wrong err path and add goto labels in kunit_filter_suites()



Take the last kfree(parsed_filters) and add it to be the first. Take
the first kfree(copy) and add it to be the last. The Best practice is to
return these errors reversely.

And as David suggested, add several labels which target only the things
which actually have been allocated so far.

Fixes: 529534e8 ("kunit: Add ability to filter attributes")
Fixes: abbf7381 ("kunit: fix possible memory leak in kunit_filter_suites()")
Signed-off-by: default avatarJinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: default avatarRae Moar <rmoar@google.com>
Suggested-by: default avatarDavid Gow <davidgow@google.com>
Reviewed-by: default avatarDavid Gow <davidgow@google.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 2810c1e9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment