From: Colin King <colin.king@canonical.com>
To: "David S . Miller" <davem@davemloft.net>,
Rob Swindell <rob.swindell@broadcom.com>,
Satish Baddipadige <sbaddipa@broadcom.com>,
Ajit Khaparde <ajit.khaparde@broadcom.com>,
netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] bnxt_en: initialize rc to zero to avoid returning garbage
Date: Fri, 8 Jul 2016 16:42:48 +0100 [thread overview]
Message-ID: <1467992568-1990-1-git-send-email-colin.king@canonical.com> (raw)
From: Colin Ian King <colin.king@canonical.com>
rc is not initialized so it can contain garbage if it is not
set by the call to bnxt_read_sfp_module_eeprom_info. Ensure
garbage is not returned by initializing rc to 0.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index 0f7dd86..64466f5 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -1684,7 +1684,7 @@ static int bnxt_get_module_eeprom(struct net_device *dev,
{
struct bnxt *bp = netdev_priv(dev);
u16 start = eeprom->offset, length = eeprom->len;
- int rc;
+ int rc = 0;
memset(data, 0, eeprom->len);
--
2.8.1
next reply other threads:[~2016-07-08 15:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-08 15:42 Colin King [this message]
2016-07-08 20:06 ` [PATCH] bnxt_en: initialize rc to zero to avoid returning garbage Michael Chan
2016-07-11 19:42 ` David Miller
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=1467992568-1990-1-git-send-email-colin.king@canonical.com \
--to=colin.king@canonical.com \
--cc=ajit.khaparde@broadcom.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rob.swindell@broadcom.com \
--cc=sbaddipa@broadcom.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;
as well as URLs for NNTP newsgroup(s).