DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ice: fix EEPROM range check
@ 2019-05-05  5:48 Xiao Wang
  2019-05-05  5:48 ` Xiao Wang
  2019-05-06  0:37 ` Zhang, Qi Z
  0 siblings, 2 replies; 4+ messages in thread
From: Xiao Wang @ 2019-05-05  5:48 UTC (permalink / raw)
  To: wenzhuo.lu; +Cc: dev, qiming.yang, leyi.rong, Xiao Wang, stable

The last word should not cross shadow RAM boundary.

Fixes: 68a1ab82ad74 ("net/ice: speed up to retrieve EEPROM")
Cc: stable@dpdk.org

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 706632424..3d2f35bb0 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -3002,8 +3002,8 @@ ice_get_eeprom(struct rte_eth_dev *dev,
 	last_word = (eeprom->offset + eeprom->length - 1) >> 1;
 	nwords = last_word - first_word + 1;
 
-	if (first_word > hw->nvm.sr_words ||
-	    last_word > hw->nvm.sr_words) {
+	if (first_word >= hw->nvm.sr_words ||
+	    last_word >= hw->nvm.sr_words) {
 		PMD_DRV_LOG(ERR, "Requested EEPROM bytes out of range.");
 		return -EINVAL;
 	}
-- 
2.15.1

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

end of thread, other threads:[~2019-05-06  0:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-05  5:48 [dpdk-dev] [PATCH] net/ice: fix EEPROM range check Xiao Wang
2019-05-05  5:48 ` Xiao Wang
2019-05-06  0:37 ` Zhang, Qi Z
2019-05-06  0:37   ` Zhang, Qi Z

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