netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] xdp: fix uninitialized 'err' variable
       [not found] <20180717015758.GB10593@intel.com>
@ 2018-07-17  2:08 ` Jakub Kicinski
  2018-07-17  6:44   ` Daniel Borkmann
  2018-07-18 20:33   ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2018-07-17  2:08 UTC (permalink / raw)
  To: davem
  Cc: daniel, alexei.starovoitov, kbuild-all, oss-drivers, netdev,
	Jakub Kicinski

Smatch caught an uninitialized variable error which GCC seems
to miss.

Fixes: a25717d2b604 ("xdp: support simultaneous driver and hw XDP attachment")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
 net/core/rtnetlink.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index e03258e954c8..92b6fa5d5f6e 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1414,14 +1414,17 @@ static int rtnl_xdp_fill(struct sk_buff *skb, struct net_device *dev)
 
 	prog_id = 0;
 	mode = XDP_ATTACHED_NONE;
-	if (rtnl_xdp_report_one(skb, dev, &prog_id, &mode, XDP_ATTACHED_SKB,
-				IFLA_XDP_SKB_PROG_ID, rtnl_xdp_prog_skb))
+	err = rtnl_xdp_report_one(skb, dev, &prog_id, &mode, XDP_ATTACHED_SKB,
+				  IFLA_XDP_SKB_PROG_ID, rtnl_xdp_prog_skb);
+	if (err)
 		goto err_cancel;
-	if (rtnl_xdp_report_one(skb, dev, &prog_id, &mode, XDP_ATTACHED_DRV,
-				IFLA_XDP_DRV_PROG_ID, rtnl_xdp_prog_drv))
+	err = rtnl_xdp_report_one(skb, dev, &prog_id, &mode, XDP_ATTACHED_DRV,
+				  IFLA_XDP_DRV_PROG_ID, rtnl_xdp_prog_drv);
+	if (err)
 		goto err_cancel;
-	if (rtnl_xdp_report_one(skb, dev, &prog_id, &mode, XDP_ATTACHED_HW,
-				IFLA_XDP_HW_PROG_ID, rtnl_xdp_prog_hw))
+	err = rtnl_xdp_report_one(skb, dev, &prog_id, &mode, XDP_ATTACHED_HW,
+				  IFLA_XDP_HW_PROG_ID, rtnl_xdp_prog_hw);
+	if (err)
 		goto err_cancel;
 
 	err = nla_put_u8(skb, IFLA_XDP_ATTACHED, mode);
-- 
2.17.1

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

* Re: [PATCH net-next] xdp: fix uninitialized 'err' variable
  2018-07-17  2:08 ` [PATCH net-next] xdp: fix uninitialized 'err' variable Jakub Kicinski
@ 2018-07-17  6:44   ` Daniel Borkmann
  2018-07-18 20:33   ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2018-07-17  6:44 UTC (permalink / raw)
  To: Jakub Kicinski, davem; +Cc: alexei.starovoitov, kbuild-all, oss-drivers, netdev

On 07/17/2018 04:08 AM, Jakub Kicinski wrote:
> Smatch caught an uninitialized variable error which GCC seems
> to miss.
> 
> Fixes: a25717d2b604 ("xdp: support simultaneous driver and hw XDP attachment")
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

David, feel free to take this directly into net-next, thanks!

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

* Re: [PATCH net-next] xdp: fix uninitialized 'err' variable
  2018-07-17  2:08 ` [PATCH net-next] xdp: fix uninitialized 'err' variable Jakub Kicinski
  2018-07-17  6:44   ` Daniel Borkmann
@ 2018-07-18 20:33   ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-07-18 20:33 UTC (permalink / raw)
  To: jakub.kicinski
  Cc: daniel, alexei.starovoitov, kbuild-all, oss-drivers, netdev

From: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Mon, 16 Jul 2018 19:08:50 -0700

> Smatch caught an uninitialized variable error which GCC seems
> to miss.
> 
> Fixes: a25717d2b604 ("xdp: support simultaneous driver and hw XDP attachment")
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>

Applied.

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

end of thread, other threads:[~2018-07-18 21:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20180717015758.GB10593@intel.com>
2018-07-17  2:08 ` [PATCH net-next] xdp: fix uninitialized 'err' variable Jakub Kicinski
2018-07-17  6:44   ` Daniel Borkmann
2018-07-18 20:33   ` David Miller

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).