diff mbox

[dpdk-dev] net/kni: remove unnecessary null check

Message ID 20170411143311.12172-1-ferruh.yigit@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Ferruh Yigit April 11, 2017, 2:33 p.m. UTC
Coverity issue: 1419721
Fixes: 75e2bc54c018 ("net/kni: add KNI PMD")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/kni/rte_eth_kni.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Ferruh Yigit April 13, 2017, 9:35 a.m. UTC | #1
On 4/11/2017 3:33 PM, Ferruh Yigit wrote:
> Coverity issue: 1419721
> Fixes: 75e2bc54c018 ("net/kni: add KNI PMD")
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/master, thanks.
diff mbox

Patch

diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index 59205e7..ed4478e 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -489,12 +489,10 @@  eth_kni_remove(const char *name)
 
 	eth_kni_dev_stop(eth_dev);
 
-	if (eth_dev->data) {
-		internals = eth_dev->data->dev_private;
-		rte_kni_release(internals->kni);
+	internals = eth_dev->data->dev_private;
+	rte_kni_release(internals->kni);
 
-		rte_free(internals);
-	}
+	rte_free(internals);
 	rte_free(eth_dev->data);
 
 	rte_eth_dev_release_port(eth_dev);