From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: "David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtnetlink: fix uninitialized variable
Date: Tue, 17 Jul 2018 10:57:25 -0700 [thread overview]
Message-ID: <20180717105725.5cb8a405@cakuba.lan> (raw)
In-Reply-To: <20180717134314.GA31127@embeddedor.com>
On Tue, 17 Jul 2018 08:43:14 -0500, Gustavo A. R. Silva wrote:
> Currently, there are execution paths in which variable err is
> returned without being properly initialized previously:
>
> 1417 if (rtnl_xdp_report_one(skb, dev, &prog_id, &mode, XDP_ATTACHED_SKB,
> 1418 IFLA_XDP_SKB_PROG_ID, rtnl_xdp_prog_skb))
> 1419 goto err_cancel;
> 1420 if (rtnl_xdp_report_one(skb, dev, &prog_id, &mode, XDP_ATTACHED_DRV,
> 1421 IFLA_XDP_DRV_PROG_ID, rtnl_xdp_prog_drv))
> 1422 goto err_cancel;
> 1423 if (rtnl_xdp_report_one(skb, dev, &prog_id, &mode, XDP_ATTACHED_HW,
> 1424 IFLA_XDP_HW_PROG_ID, rtnl_xdp_prog_hw))
> 1425 goto err_cancel;
>
> Fix this by initializing variable err to -EMSGSIZE.
>
> Addresses-Coverity-ID: 1471831 ("Uninitialized scalar variable")
> Fixes: a25717d2b604 ("xdp: support simultaneous driver and hw XDP attachment")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Looks like duplicate of:
http://patchwork.ozlabs.org/patch/944662/
Strage GCC doesn't catch this even with W=1, the code is fairly
straightforward :S
prev parent reply other threads:[~2018-07-17 17:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-17 13:43 [PATCH] rtnetlink: fix uninitialized variable Gustavo A. R. Silva
2018-07-17 17:57 ` Jakub Kicinski [this message]
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=20180717105725.5cb8a405@cakuba.lan \
--to=jakub.kicinski@netronome.com \
--cc=davem@davemloft.net \
--cc=gustavo@embeddedor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.