subsys/testsuite: Fix coverity null dereference warning
Coverity is not able to detect that the call to ztest_test_fail() will not return so it emits a warning on a later access to param. Add a return; after the call so coverity won't complain. Fixes #25790 Signed-off-by: David Leach <david.leach@nxp.com>
This commit is contained in:
parent
48f7f11998
commit
87e02c62bd
1 changed files with 5 additions and 0 deletions
|
@ -215,7 +215,12 @@ void z_ztest_check_expected_data(const char *fn, const char *name, void *data,
|
|||
param = find_and_delete_value(¶meter_list, fn, name);
|
||||
if (!param) {
|
||||
PRINT("Failed to find parameter %s for %s\n", name, fn);
|
||||
/* No return from this function but for coverity reasons
|
||||
* put a return after to avoid the warning of a null
|
||||
* dereference of param below.
|
||||
*/
|
||||
ztest_test_fail();
|
||||
return;
|
||||
}
|
||||
|
||||
expected = (void *)param->value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue