diff mbox

Fwd: [lng-odp-dpdk] [PATCH 5/5] dpdk: do not segfault in odp_queue_destroy()

Message ID 56A63934.4020406@linaro.org
State Accepted
Commit 7978583a81f35fa7030c49fe45fb696ea1ed2029
Headers show

Commit Message

Zoltan Kiss Jan. 25, 2016, 3:03 p.m. UTC
Hi Maxim,

I've spotted this patch which went in to ODP-DPDK instead of mainline 
ODP. I think it would be better to push it there as well. You can add my

Reviewed-by: Zoltan Kiss <zoltan.kiss@linaro.org>


-------- Forwarded Message --------
Subject: [lng-odp-dpdk] [PATCH 5/5] dpdk: do not segfault in 
odp_queue_destroy()
Date: Mon, 18 May 2015 13:24:32 +0300
From: Maxim Uvarov <maxim.uvarov@linaro.org>
To: lng-odp-dpdk@lists.linaro.org

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
  platform/linux-generic/odp_queue.c | 4 ++++
  1 file changed, 4 insertions(+)

Comments

Maxim Uvarov Jan. 26, 2016, 11:27 a.m. UTC | #1
Hm, yes, that is reasonable patch.

Will send it to mainline list.

Maxim.

On 01/25/2016 18:03, Zoltan Kiss wrote:
> Hi Maxim,
>
> I've spotted this patch which went in to ODP-DPDK instead of mainline 
> ODP. I think it would be better to push it there as well. You can add my
>
> Reviewed-by: Zoltan Kiss <zoltan.kiss@linaro.org>
>
>
> -------- Forwarded Message --------
> Subject: [lng-odp-dpdk] [PATCH 5/5] dpdk: do not segfault in 
> odp_queue_destroy()
> Date: Mon, 18 May 2015 13:24:32 +0300
> From: Maxim Uvarov <maxim.uvarov@linaro.org>
> To: lng-odp-dpdk@lists.linaro.org
>
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> ---
>  platform/linux-generic/odp_queue.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/platform/linux-generic/odp_queue.c 
> b/platform/linux-generic/odp_queue.c
> index 4a0465b..63744af 100644
> --- a/platform/linux-generic/odp_queue.c
> +++ b/platform/linux-generic/odp_queue.c
> @@ -247,6 +247,10 @@ void queue_destroy_finalize(queue_entry_t *queue)
>  int odp_queue_destroy(odp_queue_t handle)
>  {
>      queue_entry_t *queue;
> +
> +    if (handle == ODP_QUEUE_INVALID)
> +        return -1;
> +
>      queue = queue_to_qentry(handle);
>
>      LOCK(&queue->s.lock);
diff mbox

Patch

diff --git a/platform/linux-generic/odp_queue.c 
b/platform/linux-generic/odp_queue.c
index 4a0465b..63744af 100644
--- a/platform/linux-generic/odp_queue.c
+++ b/platform/linux-generic/odp_queue.c
@@ -247,6 +247,10 @@  void queue_destroy_finalize(queue_entry_t *queue)
  int odp_queue_destroy(odp_queue_t handle)
  {
  	queue_entry_t *queue;
+
+	if (handle == ODP_QUEUE_INVALID)
+		return -1;
+
  	queue = queue_to_qentry(handle);

  	LOCK(&queue->s.lock);