netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] lib: test_objagg: Set error message in check_expect_hints_stats()
@ 2025-06-30 19:36 Dan Carpenter
  2025-07-01 12:18 ` Ido Schimmel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2025-06-30 19:36 UTC (permalink / raw)
  To: Jiri Pirko, Arnd Bergmann
  Cc: Andrew Morton, Ido Schimmel, David S. Miller, linux-kernel,
	netdev, kernel-janitors

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: 0a020d416d0a ("lib: introduce initial implementation of object aggregation manager")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 lib/test_objagg.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/test_objagg.c b/lib/test_objagg.c
index a67b8ef5c5be..ce5c4c36a084 100644
--- a/lib/test_objagg.c
+++ b/lib/test_objagg.c
@@ -899,8 +899,10 @@ static int check_expect_hints_stats(struct objagg_hints *objagg_hints,
 	int err;
 
 	stats = objagg_hints_stats_get(objagg_hints);
-	if (IS_ERR(stats))
+	if (IS_ERR(stats)) {
+		*errmsg = "objagg_hints_stats_get() failed.";
 		return PTR_ERR(stats);
+	}
 	err = __check_expect_stats(stats, expect_stats, errmsg);
 	objagg_stats_put(stats);
 	return err;
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] lib: test_objagg: Set error message in check_expect_hints_stats()
  2025-06-30 19:36 [PATCH net] lib: test_objagg: Set error message in check_expect_hints_stats() Dan Carpenter
@ 2025-07-01 12:18 ` Ido Schimmel
  2025-07-01 19:43 ` Simon Horman
  2025-07-02  0:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Ido Schimmel @ 2025-07-01 12:18 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Jiri Pirko, Arnd Bergmann, Andrew Morton, Ido Schimmel,
	David S. Miller, linux-kernel, netdev, kernel-janitors

On Mon, Jun 30, 2025 at 02:36:40PM -0500, Dan Carpenter wrote:
> 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: 0a020d416d0a ("lib: introduce initial implementation of object aggregation manager")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] lib: test_objagg: Set error message in check_expect_hints_stats()
  2025-06-30 19:36 [PATCH net] lib: test_objagg: Set error message in check_expect_hints_stats() Dan Carpenter
  2025-07-01 12:18 ` Ido Schimmel
@ 2025-07-01 19:43 ` Simon Horman
  2025-07-02  0:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2025-07-01 19:43 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Jiri Pirko, Arnd Bergmann, Andrew Morton, Ido Schimmel,
	David S. Miller, linux-kernel, netdev, kernel-janitors

On Mon, Jun 30, 2025 at 02:36:40PM -0500, Dan Carpenter wrote:
> 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: 0a020d416d0a ("lib: introduce initial implementation of object aggregation manager")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] lib: test_objagg: Set error message in check_expect_hints_stats()
  2025-06-30 19:36 [PATCH net] lib: test_objagg: Set error message in check_expect_hints_stats() Dan Carpenter
  2025-07-01 12:18 ` Ido Schimmel
  2025-07-01 19:43 ` Simon Horman
@ 2025-07-02  0:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-07-02  0:40 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: jiri, arnd, akpm, idosch, davem, linux-kernel, netdev,
	kernel-janitors

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 30 Jun 2025 14:36:40 -0500 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net] lib: test_objagg: Set error message in check_expect_hints_stats()
    https://git.kernel.org/netdev/net/c/e6ed134a4ef5

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-02  0:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-30 19:36 [PATCH net] lib: test_objagg: Set error message in check_expect_hints_stats() Dan Carpenter
2025-07-01 12:18 ` Ido Schimmel
2025-07-01 19:43 ` Simon Horman
2025-07-02  0:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).