mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Lobakin <alobakin@marvell.com>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: Igor Russkikh <irusskikh@marvell.com>,
	Michal Kalderon <michal.kalderon@marvell.com>,
	Ariel Elior <aelior@marvell.com>,
	Yuval Mintz <yuval.mintz@marvell.com>,
	Denis Bolotin <denis.bolotin@marvell.com>,
	"Ram Amrani" <ram.amrani@marvell.com>,
	Tomer Tayar <tomer.tayar@marvell.com>,
	Alexander Lobakin <alobakin@marvell.com>,
	<GR-everest-linux-l2@marvell.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH net 9/9] net: qed: fix "maybe uninitialized" warning
Date: Mon, 22 Jun 2020 14:14:13 +0300	[thread overview]
Message-ID: <20200622111413.7006-10-alobakin@marvell.com> (raw)
In-Reply-To: <20200622111413.7006-1-alobakin@marvell.com>

Variable 'abs_ppfid' in qed_dev.c:qed_llh_add_mac_filter() always gets
printed, but is initialized only under 'ref_cnt == 1' condition. This
results in:

In file included from ./include/linux/kernel.h:15:0,
                 from ./include/asm-generic/bug.h:19,
                 from ./arch/x86/include/asm/bug.h:86,
                 from ./include/linux/bug.h:5,
                 from ./include/linux/io.h:11,
                 from drivers/net/ethernet/qlogic/qed/qed_dev.c:35:
drivers/net/ethernet/qlogic/qed/qed_dev.c: In function 'qed_llh_add_mac_filter':
./include/linux/printk.h:358:2: warning: 'abs_ppfid' may be used uninitialized
in this function [-Wmaybe-uninitialized]
  printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
  ^~~~~~
drivers/net/ethernet/qlogic/qed/qed_dev.c:983:17: note: 'abs_ppfid' was declared
here
  u8 filter_idx, abs_ppfid;
                 ^~~~~~~~~

...under W=1+.

Fix this by initializing it with zero.

Fixes: 79284adeb99e ("qed: Add llh ppfid interface and 100g support for
offload protocols")
Signed-off-by: Alexander Lobakin <alobakin@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com>
---
 drivers/net/ethernet/qlogic/qed/qed_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c
index b41ada668948..3aa51374e727 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dev.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c
@@ -980,7 +980,7 @@ int qed_llh_add_mac_filter(struct qed_dev *cdev,
 	struct qed_hwfn *p_hwfn = QED_LEADING_HWFN(cdev);
 	struct qed_ptt *p_ptt = qed_ptt_acquire(p_hwfn);
 	union qed_llh_filter filter = {};
-	u8 filter_idx, abs_ppfid;
+	u8 filter_idx, abs_ppfid = 0;
 	u32 high, low, ref_cnt;
 	int rc = 0;
 
-- 
2.21.0


  parent reply	other threads:[~2020-06-22 11:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 11:14 [PATCH net 0/9] net: qed/qede: various stability fixes Alexander Lobakin
2020-06-22 11:14 ` [PATCH net 1/9] net: qed: fix left elements count calculation Alexander Lobakin
2020-06-22 11:14 ` [PATCH net 2/9] net: qed: fix async event callbacks unregistering Alexander Lobakin
2020-06-22 11:14 ` [PATCH net 3/9] net: qede: stop adding events on an already destroyed workqueue Alexander Lobakin
2020-06-22 11:14 ` [PATCH net 4/9] net: qed: fix NVMe login fails over VFs Alexander Lobakin
2020-06-22 11:14 ` [PATCH net 5/9] net: qed: fix excessive QM ILT lines consumption Alexander Lobakin
2020-06-22 11:14 ` [PATCH net 6/9] net: qede: fix PTP initialization on recovery Alexander Lobakin
2020-06-22 11:14 ` [PATCH net 7/9] net: qede: fix use-after-free on recovery and AER handling Alexander Lobakin
2020-06-22 11:14 ` [PATCH net 8/9] net: qed: reset ILT block sizes before recomputing to fix crashes Alexander Lobakin
2020-06-22 11:14 ` Alexander Lobakin [this message]
2020-06-22 21:44   ` [PATCH net 9/9] net: qed: fix "maybe uninitialized" warning Jakub Kicinski
2020-06-23 12:16     ` Alexander Lobakin

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=20200622111413.7006-10-alobakin@marvell.com \
    --to=alobakin@marvell.com \
    --cc=GR-everest-linux-l2@marvell.com \
    --cc=aelior@marvell.com \
    --cc=davem@davemloft.net \
    --cc=denis.bolotin@marvell.com \
    --cc=irusskikh@marvell.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.kalderon@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=ram.amrani@marvell.com \
    --cc=tomer.tayar@marvell.com \
    --cc=yuval.mintz@marvell.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

all inboxes | Powered by JetHome®