[dpdk-dev,v1,1/2] net/octeontx: fix null pointer dereference

Message ID 1519146856-10748-1-git-send-email-santosh.shukla@caviumnetworks.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

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

Commit Message

Santosh Shukla Feb. 20, 2018, 5:14 p.m. UTC
  Fixes: f18b146c498d ("net/octeontx: create ethdev ports")
Coverity issue: 195040

Cc: stable@dpdk.org
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
 drivers/net/octeontx/octeontx_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ferruh Yigit March 6, 2018, 5:51 p.m. UTC | #1
On 2/20/2018 5:14 PM, Santosh Shukla wrote:
> Fixes: f18b146c498d ("net/octeontx: create ethdev ports")
> Coverity issue: 195040
> 
> Cc: stable@dpdk.org
> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>

Series applied to dpdk-next-net/master, thanks.

BTW, what is the plan to switching new offloading API in PMD? This release it is
planned to remove support for old API.
  
Pavan Nikhilesh March 7, 2018, 8:20 a.m. UTC | #2
On Tue, Mar 06, 2018 at 05:51:27PM +0000, Ferruh Yigit wrote:
> On 2/20/2018 5:14 PM, Santosh Shukla wrote:
> > Fixes: f18b146c498d ("net/octeontx: create ethdev ports")
> > Coverity issue: 195040
> >
> > Cc: stable@dpdk.org
> > Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
>
> Series applied to dpdk-next-net/master, thanks.
>
Hi Ferruh,

> BTW, what is the plan to switching new offloading API in PMD? This release it is
> planned to remove support for old API.

Thanks for the heads up, we will send out a patch switching to the new offload
scheme.

Pavan.
  

Patch

diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
index b739c0b..0d8937c 100644
--- a/drivers/net/octeontx/octeontx_ethdev.c
+++ b/drivers/net/octeontx/octeontx_ethdev.c
@@ -1149,7 +1149,7 @@  octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev,
 	return data->port_id;
 
 err:
-	if (port)
+	if (nic)
 		octeontx_port_close(nic);
 
 	if (eth_dev != NULL) {