net/kni: fix return value check

Message ID 20190423154319.86979-1-ferruh.yigit@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/kni: fix return value check |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Ferruh Yigit April 23, 2019, 3:43 p.m. UTC
  'rte_kni_release()' return value is not checked, adding it.

Coverity issue: 336837
Fixes: 75e2bc54c018 ("net/kni: add KNI PMD")
Cc: stable@dpdk.org

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

Comments

Ferruh Yigit April 24, 2019, 4:49 p.m. UTC | #1
On 4/23/2019 4:43 PM, Ferruh Yigit wrote:
> 'rte_kni_release()' return value is not checked, adding it.
> 
> Coverity issue: 336837
> Fixes: 75e2bc54c018 ("net/kni: add KNI PMD")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

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

Patch

diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index 89f44737c..1f232e4da 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -459,6 +459,7 @@  eth_kni_remove(struct rte_vdev_device *vdev)
 	struct rte_eth_dev *eth_dev;
 	struct pmd_internals *internals;
 	const char *name;
+	int ret;
 
 	name = rte_vdev_device_name(vdev);
 	PMD_LOG(INFO, "Un-Initializing eth_kni for %s", name);
@@ -477,7 +478,9 @@  eth_kni_remove(struct rte_vdev_device *vdev)
 	eth_kni_dev_stop(eth_dev);
 
 	internals = eth_dev->data->dev_private;
-	rte_kni_release(internals->kni);
+	ret = rte_kni_release(internals->kni);
+	if (ret)
+		PMD_LOG(WARNING, "Not able to release kni for %s", name);
 
 	rte_eth_dev_release_port(eth_dev);