[dpdk-stable] patch 'net/i40e: fix dereference before check when getting EEPROM' has been queued to LTS release 18.11.2

Kevin Traynor ktraynor at redhat.com
Wed May 8 12:15:19 CEST 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/13/19. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/3dda1ec6f6eab9c283a95cc3e110feb8c9df54af

Thanks.

Kevin Traynor

---
>From 3dda1ec6f6eab9c283a95cc3e110feb8c9df54af Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Mon, 8 Apr 2019 10:46:40 +0100
Subject: [PATCH] net/i40e: fix dereference before check when getting EEPROM

[ upstream commit f2088e785cca5d0d6471aaebe90c0f8dabc5d069 ]

As flagged by coverity, the "info" structure is being explicitly
dereferenced before being checked later for a NULL value.

Coverity issue: 277241
Fixes: 98e60c0d43f1 ("net/i40e: add module EEPROM callbacks for i40e")

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Rami Rosen <ramirose at gmail.com>
---
 drivers/net/i40e/i40e_ethdev.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 3815aef6c..036c34d09 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -11892,9 +11892,9 @@ static int i40e_get_module_eeprom(struct rte_eth_dev *dev,
 	bool is_sfp = false;
 	i40e_status status;
-	uint8_t *data = info->data;
+	uint8_t *data;
 	uint32_t value = 0;
 	uint32_t i;
 
-	if (!info || !info->length || !data)
+	if (!info || !info->length || !info->data)
 		return -EINVAL;
 
@@ -11902,4 +11902,5 @@ static int i40e_get_module_eeprom(struct rte_eth_dev *dev,
 		is_sfp = true;
 
+	data = info->data;
 	for (i = 0; i < info->length; i++) {
 		u32 offset = i + info->offset;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-05-08 11:05:07.660552920 +0100
+++ 0037-net-i40e-fix-dereference-before-check-when-getting-E.patch	2019-05-08 11:05:05.830932740 +0100
@@ -1 +1 @@
-From f2088e785cca5d0d6471aaebe90c0f8dabc5d069 Mon Sep 17 00:00:00 2001
+From 3dda1ec6f6eab9c283a95cc3e110feb8c9df54af Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f2088e785cca5d0d6471aaebe90c0f8dabc5d069 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index f6fc0056c..301193492 100644
+index 3815aef6c..036c34d09 100644
@@ -23 +24 @@
-@@ -11901,9 +11901,9 @@ static int i40e_get_module_eeprom(struct rte_eth_dev *dev,
+@@ -11892,9 +11892,9 @@ static int i40e_get_module_eeprom(struct rte_eth_dev *dev,
@@ -35 +36 @@
-@@ -11911,4 +11911,5 @@ static int i40e_get_module_eeprom(struct rte_eth_dev *dev,
+@@ -11902,4 +11902,5 @@ static int i40e_get_module_eeprom(struct rte_eth_dev *dev,


More information about the stable mailing list