net/octeontx: fix null pointer dereference
authorSantosh Shukla <santosh.shukla@caviumnetworks.com>
Tue, 20 Feb 2018 17:14:15 +0000 (22:44 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 30 Mar 2018 12:08:43 +0000 (14:08 +0200)
Coverity issue: 195040
Fixes: f18b146c498d ("net/octeontx: create ethdev ports")
Cc: stable@dpdk.org
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
drivers/net/octeontx/octeontx_ethdev.c

index b739c0b..0d8937c 100644 (file)
@@ -1149,7 +1149,7 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev,
        return data->port_id;
 
 err:
        return data->port_id;
 
 err:
-       if (port)
+       if (nic)
                octeontx_port_close(nic);
 
        if (eth_dev != NULL) {
                octeontx_port_close(nic);
 
        if (eth_dev != NULL) {