Skip to content

Commit e6ed134

Browse files
Dan Carpenterkuba-moo
authored andcommitted
lib: test_objagg: Set error message in check_expect_hints_stats()
Smatch complains that the error message isn't set in the caller: lib/test_objagg.c:923 test_hints_case2() error: uninitialized symbol 'errmsg'. This static checker warning only showed up after a recent refactoring but the bug dates back to when the code was originally added. This likely doesn't affect anything in real life. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/r/202506281403.DsuyHFTZ-lkp@intel.com/ Fixes: 0a020d4 ("lib: introduce initial implementation of object aggregation manager") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/8548f423-2e3b-4bb7-b816-5041de2762aa@sabinyo.mountain Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 72fb837 commit e6ed134

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/test_objagg.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,10 @@ static int check_expect_hints_stats(struct objagg_hints *objagg_hints,
899899
int err;
900900

901901
stats = objagg_hints_stats_get(objagg_hints);
902-
if (IS_ERR(stats))
902+
if (IS_ERR(stats)) {
903+
*errmsg = "objagg_hints_stats_get() failed.";
903904
return PTR_ERR(stats);
905+
}
904906
err = __check_expect_stats(stats, expect_stats, errmsg);
905907
objagg_stats_put(stats);
906908
return err;

0 commit comments

Comments
 (0)