diff mbox series

[2/3] compress/isal: set null pointer after freeing

Message ID 20180711063846.47189-2-pablo.de.lara.guarch@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Pablo de Lara Guarch
Headers show
Series [1/3] compress/isal: fix logtype name | expand

Checks

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

Commit Message

De Lara Guarch, Pablo July 11, 2018, 6:38 a.m. UTC
Fixes: b0e23c458a6f ("compress/isal: add queue pair related ops")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 drivers/compress/isal/isal_compress_pmd_ops.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Daly, Lee July 11, 2018, 4:14 p.m. UTC | #1
> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Wednesday, July 11, 2018 7:39 AM
> To: Daly, Lee <lee.daly@intel.com>
> Cc: dev@dpdk.org; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;
> stable@dpdk.org
> Subject: [PATCH 2/3] compress/isal: set null pointer after freeing
> 
> Fixes: b0e23c458a6f ("compress/isal: add queue pair related ops")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---
>  drivers/compress/isal/isal_compress_pmd_ops.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/compress/isal/isal_compress_pmd_ops.c
> b/drivers/compress/isal/isal_compress_pmd_ops.c
> index 585f22802..0738fb9c4 100644
> --- a/drivers/compress/isal/isal_compress_pmd_ops.c
> +++ b/drivers/compress/isal/isal_compress_pmd_ops.c
> @@ -167,8 +167,8 @@ isal_comp_pmd_qp_release(struct rte_compressdev
> *dev, uint16_t qp_id)
>  	if (qp->state != NULL)
>  		rte_free(qp->state);
> 
> -	if (dev->data->queue_pairs[qp_id] != NULL)
> -		rte_free(dev->data->queue_pairs[qp_id]);
> +	rte_free(qp);
> +	dev->data->queue_pairs[qp_id] = NULL;
> 
>  	return 0;
>  }
> --
> 2.14.4
Acked-by: Lee Daly <lee.daly@intel.com>
diff mbox series

Patch

diff --git a/drivers/compress/isal/isal_compress_pmd_ops.c b/drivers/compress/isal/isal_compress_pmd_ops.c
index 585f22802..0738fb9c4 100644
--- a/drivers/compress/isal/isal_compress_pmd_ops.c
+++ b/drivers/compress/isal/isal_compress_pmd_ops.c
@@ -167,8 +167,8 @@  isal_comp_pmd_qp_release(struct rte_compressdev *dev, uint16_t qp_id)
 	if (qp->state != NULL)
 		rte_free(qp->state);
 
-	if (dev->data->queue_pairs[qp_id] != NULL)
-		rte_free(dev->data->queue_pairs[qp_id]);
+	rte_free(qp);
+	dev->data->queue_pairs[qp_id] = NULL;
 
 	return 0;
 }