[2/3] crypto/octeontx: fix null pointer dereferencing

Message ID 1541949837-9629-3-git-send-email-anoob.joseph@caviumnetworks.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series fixing coverity reported issues |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK

Commit Message

Anoob Joseph Nov. 11, 2018, 3:24 p.m. UTC
  Fixes: bfe2ae495ee2 ("crypto/octeontx: add PMD skeleton")

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
---
 drivers/crypto/octeontx/otx_cryptodev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Akhil Goyal Nov. 12, 2018, 11:20 a.m. UTC | #1
Hi Anoob,

On 11/11/2018 8:54 PM, Anoob Joseph wrote:
> Fixes: bfe2ae495ee2 ("crypto/octeontx: add PMD skeleton")
>
> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
> ---
>   drivers/crypto/octeontx/otx_cryptodev.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/crypto/octeontx/otx_cryptodev.c b/drivers/crypto/octeontx/otx_cryptodev.c
> index 269f045..b201e0a 100644
> --- a/drivers/crypto/octeontx/otx_cryptodev.c
> +++ b/drivers/crypto/octeontx/otx_cryptodev.c
> @@ -100,8 +100,8 @@ otx_cpt_pci_remove(struct rte_pci_device *pci_dev)
>   	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
>   		rte_free(cryptodev->data->dev_private);
>   
> -	cryptodev->device = NULL;
>   	cryptodev->device->driver = NULL;
> +	cryptodev->device = NULL;
>   	cryptodev->data = NULL;
>   
>   	/* free metapool memory */
Can we squash the entire series into a single patch or at least 2/3 and 
3/3 should be merged.
You can have more than one fixes lines in a single patch.

-Akhil
  
Joseph, Anoob Nov. 12, 2018, 11:23 a.m. UTC | #2
Hi Akhil,

You can squash the entire series. Or should I send a revised patch? Either way is fine.

Anoob

> -----Original Message-----
> From: Akhil Goyal <akhil.goyal@nxp.com>
> Sent: 12 November 2018 16:51
> To: Joseph, Anoob <Anoob.Joseph@cavium.com>; Pablo de Lara
> <pablo.de.lara.guarch@intel.com>
> Cc: Joseph, Anoob <Anoob.Joseph@cavium.com>; Jacob, Jerin
> <Jerin.JacobKollanukkaran@cavium.com>; Athreya, Narayana Prasad
> <NarayanaPrasad.Athreya@cavium.com>; Dwivedi, Ankur
> <Ankur.Dwivedi@cavium.com>; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 2/3] crypto/octeontx: fix null pointer
> dereferencing
> 
> External Email
> 
> Hi Anoob,
> 
> On 11/11/2018 8:54 PM, Anoob Joseph wrote:
> > Fixes: bfe2ae495ee2 ("crypto/octeontx: add PMD skeleton")
> >
> > Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
> > ---
> >   drivers/crypto/octeontx/otx_cryptodev.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/crypto/octeontx/otx_cryptodev.c
> b/drivers/crypto/octeontx/otx_cryptodev.c
> > index 269f045..b201e0a 100644
> > --- a/drivers/crypto/octeontx/otx_cryptodev.c
> > +++ b/drivers/crypto/octeontx/otx_cryptodev.c
> > @@ -100,8 +100,8 @@ otx_cpt_pci_remove(struct rte_pci_device *pci_dev)
> >       if (rte_eal_process_type() == RTE_PROC_PRIMARY)
> >               rte_free(cryptodev->data->dev_private);
> >
> > -     cryptodev->device = NULL;
> >       cryptodev->device->driver = NULL;
> > +     cryptodev->device = NULL;
> >       cryptodev->data = NULL;
> >
> >       /* free metapool memory */
> Can we squash the entire series into a single patch or at least 2/3 and
> 3/3 should be merged.
> You can have more than one fixes lines in a single patch.
> 
> -Akhil
  
Akhil Goyal Nov. 12, 2018, 11:45 a.m. UTC | #3
Hi Anoob,

On 11/12/2018 4:53 PM, Joseph, Anoob wrote:
> Hi Akhil,
>
> You can squash the entire series. Or should I send a revised patch? Either way is fine.
You can send a revised patch with coverity ID and appropriate patch 
description for all the issues resolved here.

-Akhil
  

Patch

diff --git a/drivers/crypto/octeontx/otx_cryptodev.c b/drivers/crypto/octeontx/otx_cryptodev.c
index 269f045..b201e0a 100644
--- a/drivers/crypto/octeontx/otx_cryptodev.c
+++ b/drivers/crypto/octeontx/otx_cryptodev.c
@@ -100,8 +100,8 @@  otx_cpt_pci_remove(struct rte_pci_device *pci_dev)
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
 		rte_free(cryptodev->data->dev_private);
 
-	cryptodev->device = NULL;
 	cryptodev->device->driver = NULL;
+	cryptodev->device = NULL;
 	cryptodev->data = NULL;
 
 	/* free metapool memory */