From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net, kuba@kernel.org
Cc: Sasha Neftin <sasha.neftin@intel.com>,
netdev@vger.kernel.org, sassmann@redhat.com,
anthony.l.nguyen@intel.com, vitaly.lifshits@intel.com,
Dan Carpenter <dan.carpenter@oracle.com>,
Dvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>
Subject: [PATCH net-next 5/6] igc: Fix overwrites return value
Date: Fri, 16 Apr 2021 13:44:59 -0700 [thread overview]
Message-ID: <20210416204500.2012073-6-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20210416204500.2012073-1-anthony.l.nguyen@intel.com>
From: Sasha Neftin <sasha.neftin@intel.com>
drivers/net/ethernet/intel/igc/igc_i225.c:235 igc_write_nvm_srwr()
warn: loop overwrites return value 'ret_val'
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/igc/igc_i225.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_i225.c b/drivers/net/ethernet/intel/igc/igc_i225.c
index cc83bb5c15e8..b2ef9fde97b3 100644
--- a/drivers/net/ethernet/intel/igc/igc_i225.c
+++ b/drivers/net/ethernet/intel/igc/igc_i225.c
@@ -229,10 +229,11 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words,
if (offset >= nvm->word_size || (words > (nvm->word_size - offset)) ||
words == 0) {
hw_dbg("nvm parameter(s) out of bounds\n");
- goto out;
+ return ret_val;
}
for (i = 0; i < words; i++) {
+ ret_val = -IGC_ERR_NVM;
eewr = ((offset + i) << IGC_NVM_RW_ADDR_SHIFT) |
(data[i] << IGC_NVM_RW_REG_DATA) |
IGC_NVM_RW_REG_START;
@@ -254,7 +255,6 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words,
}
}
-out:
return ret_val;
}
--
2.26.2
next prev parent reply other threads:[~2021-04-16 20:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-16 20:44 [PATCH net-next 0/6][pull request] 1GbE Intel Wired LAN Driver Updates 2021-04-16 Tony Nguyen
2021-04-16 20:44 ` [PATCH net-next 1/6] igb: Redistribute memory for transmit packet buffers when in Qav mode Tony Nguyen
2021-04-16 20:44 ` [PATCH net-next 2/6] igb: Add double-check MTA_REGISTER for i210 and i211 Tony Nguyen
2021-04-16 21:12 ` Jakub Kicinski
2021-04-20 16:22 ` Nguyen, Anthony L
2021-05-10 13:43 ` Nick Lowe
2021-05-10 14:01 ` Nick Lowe
2021-05-13 12:19 ` Siwik, Grzegorz
2021-04-16 20:44 ` [PATCH net-next 3/6] igc: Enable internal i225 PPS Tony Nguyen
2021-04-16 20:44 ` [PATCH net-next 4/6] igc: enable auxiliary PHC functions for the i225 Tony Nguyen
2021-04-16 20:44 ` Tony Nguyen [this message]
2021-04-16 20:45 ` [PATCH net-next 6/6] igc: Expose LPI counters Tony Nguyen
2021-04-17 0:20 ` [PATCH net-next 0/6][pull request] 1GbE Intel Wired LAN Driver Updates 2021-04-16 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=20210416204500.2012073-6-anthony.l.nguyen@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=dvorax.fuxbrumer@linux.intel.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sasha.neftin@intel.com \
--cc=sassmann@redhat.com \
--cc=vitaly.lifshits@intel.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).