Skip to contentSkip to conversation

devlink: remove a dubious assumption in fmsg dumping

PATCH Applied Jakub Kicinski 3 participants 3 messages Jan 24, 2023 – Jan 25, 2023

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 devlink: remove a dubious assumption in fmsg dumping

Build bot detects that err may be returned uninitialized in devlink_fmsg_prepare_skb(). This is not really true because all fmsgs users should create at least one outer nest, and therefore fmsg can't be completely empty.

That said the assumption is not trivial to confirm, so let's follow the bots advice, anyway.

This code does not seem to have changed since its inception in commit 1db64e8733f6 ("devlink: Add devlink formatted message (fmsg) API")

---
 net/devlink/leftover.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/devlink/leftover.c +1 -1
index 8eab95cae917..74621287f4e5 100644
@@ -7116,8 +7116,8 @@ devlink_fmsg_prepare_skb(struct devlink_fmsg *fmsg, struct sk_buff *skb,
 {
 	struct devlink_fmsg_item *item;
 	struct nlattr *fmsg_nlattr;
+	int err = 0;
 	int i = 0;
-	int err;
 
 	fmsg_nlattr = nla_nest_start_noflag(skb, DEVLINK_ATTR_FMSG);
 	if (!fmsg_nlattr)
Signature · 1 line
2.39.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Tue, Jan 24, 2023 at 04:52:31AM CET, [email protected] wrote:

Build bot detects that err may be returned uninitialized in devlink_fmsg_prepare_skb(). This is not really true because all fmsgs users should create at least one outer nest, and therefore fmsg can't be completely empty.

Quoted 7 lines

That said the assumption is not trivial to confirm, so let's follow the bots advice, anyway.

This code does not seem to have changed since its inception in commit 1db64e8733f6 ("devlink: Add devlink formatted message (fmsg) API")

#2 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Mon, 23 Jan 2023 19:52:31 -0800 you wrote:

Build bot detects that err may be returned uninitialized in devlink_fmsg_prepare_skb(). This is not really true because all fmsgs users should create at least one outer nest, and therefore fmsg can't be completely empty.

That said the assumption is not trivial to confirm, so let's follow the bots advice, anyway.

[...]

Here is the summary with links:
- [net-next] devlink: remove a dubious assumption in fmsg dumping

    https://git.kernel.org/netdev/net-next/c/4373a023e038

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html