[dpdk-stable] patch 'net/i40e/base: fix division by zero' has been queued to stable release 16.11.1

Yuanhan Liu yuanhan.liu at linux.intel.com
Mon Jan 23 08:47:02 CET 2017


Hi,

FYI, your patch has been queued to stable release 16.11.1

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

---

Note 16.11 is a LTS release. v16.11.1 is planned to be released
shortly (about 2-3 weeks) after v17.02.

---

Thanks.

	--yliu

---
>From c37b4644a0a5e0aff793739d07587c0e004bce21 Mon Sep 17 00:00:00 2001
From: Jingjing Wu <jingjing.wu at intel.com>
Date: Sat, 10 Dec 2016 19:24:50 +0800
Subject: [PATCH] net/i40e/base: fix division by zero

[ upstream commit 5a26067443621bf77e582be69b433540f7e657a8 ]

For some cases when reading from device are incorrect or image is
incorrect, this part of code causes crash due to division by zero.

Fixes: 8db9e2a1b232 ("i40e: base driver")

Signed-off-by: Jingjing Wu <jingjing.wu at intel.com>
---
 drivers/net/i40e/base/i40e_common.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
index 02d9277..9a7c5e1 100644
--- a/drivers/net/i40e/base/i40e_common.c
+++ b/drivers/net/i40e/base/i40e_common.c
@@ -3879,8 +3879,10 @@ STATIC void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
 	/* partition id is 1-based, and functions are evenly spread
 	 * across the ports as partitions
 	 */
-	hw->partition_id = (hw->pf_id / hw->num_ports) + 1;
-	hw->num_partitions = num_functions / hw->num_ports;
+	if (hw->num_ports != 0) {
+		hw->partition_id = (hw->pf_id / hw->num_ports) + 1;
+		hw->num_partitions = num_functions / hw->num_ports;
+	}
 
 	/* additional HW specific goodies that might
 	 * someday be HW version specific
-- 
1.9.0



More information about the stable mailing list