[dpdk-dev] [PATCH 3/6] i40e: fix problematic dereference
Helin Zhang
helin.zhang at intel.com
Thu Apr 21 05:42:54 CEST 2016
Fix issue reported by Coverity.
Coverity ID 13294: Dereference before null check.
Fixes: a778a1fa2e4e ("i40e: set up and initialize flow director")
Signed-off-by: Helin Zhang <helin.zhang at intel.com>
---
drivers/net/i40e/i40e_rxtx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 31bfc44..4fd96fe 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -2981,13 +2981,15 @@ i40e_fdir_setup_tx_resources(struct i40e_pf *pf)
struct i40e_tx_queue *txq;
const struct rte_memzone *tz = NULL;
uint32_t ring_size;
- struct rte_eth_dev *dev = pf->adapter->eth_dev;
+ struct rte_eth_dev *dev;
if (!pf) {
PMD_DRV_LOG(ERR, "PF is not available");
return I40E_ERR_BAD_PTR;
}
+ dev = pf->adapter->eth_dev;
+
/* Allocate the TX queue data structure. */
txq = rte_zmalloc_socket("i40e fdir tx queue",
sizeof(struct i40e_tx_queue),
--
2.5.0
More information about the dev
mailing list