From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
jiri@resnulli.us, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next] devlink: remove a dubious assumption in fmsg dumping
Date: Mon, 23 Jan 2023 19:52:31 -0800 [thread overview]
Message-ID: <20230124035231.787381-1-kuba@kernel.org> (raw)
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")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
net/devlink/leftover.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/devlink/leftover.c b/net/devlink/leftover.c
index 8eab95cae917..74621287f4e5 100644
--- a/net/devlink/leftover.c
+++ b/net/devlink/leftover.c
@@ -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)
--
2.39.1
next reply other threads:[~2023-01-24 3:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-24 3:52 Jakub Kicinski [this message]
2023-01-24 12:18 ` [PATCH net-next] devlink: remove a dubious assumption in fmsg dumping Jiri Pirko
2023-01-25 4:40 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230124035231.787381-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox