From 39c722626590632411252114beb5359548031775 Mon Sep 17 00:00:00 2001 From: Daniel Mrzyglod Date: Mon, 18 Apr 2016 19:13:23 +0200 Subject: [PATCH] i40e: remove unneeded NULL check In i40evf_config_vlan_pvid the check for NULL for the dev value is unnecessary, since this value is passed in from the ethdev API which will ensure that a valid rte_eth_dev structure is provided. Furthermore, all code paths leading to this function already use the dev value. Issue identified by Coverity. Coverity ID 13302: There may be a null pointer dereference, or else the comparison against null is unnecessary. In i40evf_config_vlan_pvid: All paths that lead to this null pointer comparison already dereference the pointer earlier Fixes: 2b12431b5369 ("i40e: add vlan stripping and insertion to VF") Signed-off-by: Daniel Mrzyglod Acked-by: Helin Zhang Acked-by: Jingjing Wu --- drivers/net/i40e/i40e_ethdev_vf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 2bce69b3dd..2d75b9633a 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -538,7 +538,7 @@ i40evf_config_vlan_pvid(struct rte_eth_dev *dev, struct vf_cmd_info args; struct i40e_virtchnl_pvid_info tpid_info; - if (dev == NULL || info == NULL) { + if (info == NULL) { PMD_DRV_LOG(ERR, "invalid parameters"); return I40E_ERR_PARAM; } -- 2.20.1