[dpdk-stable] patch 'ethdev: prevent duplicate event callback' has been queued to stable release 16.07.2

Yuanhan Liu yuanhan.liu at linux.intel.com
Wed Nov 2 11:21:23 CET 2016


Hi,

FYI, your patch has been queued to stable release 16.07.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
yet. It will be pushed if I get no objections before 11/06/16.
So please shout if anyone has objections.

Thanks.

	--yliu

---
>From 1ffa501cf744a6549c90c2a99aa20d9706f16263 Mon Sep 17 00:00:00 2001
From: "E. Scott Daniels" <daniels at research.att.com>
Date: Thu, 20 Oct 2016 09:34:41 -0400
Subject: [PATCH] ethdev: prevent duplicate event callback

[ upstream commit dbffbf80e99aad7c7a5ffaf78e750ae69963f9e0 ]

This change prevents the attempt to add a structure which is
already on the callback list. If a struct with matching
parameters is found on the list, then no action is taken.

Fixes: ac2f69c ("ethdev: fix crash if malloc of user callback fails")

Signed-off-by: E. Scott Daniels <daniels at research.att.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu at intel.com>
---
 lib/librte_ether/rte_ethdev.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index f62a9ec..cc77e90 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -2629,14 +2629,15 @@ rte_eth_dev_callback_register(uint8_t port_id,
 	}
 
 	/* create a new callback. */
-	if (user_cb == NULL)
+	if (user_cb == NULL) {
 		user_cb = rte_zmalloc("INTR_USER_CALLBACK",
 					sizeof(struct rte_eth_dev_callback), 0);
-	if (user_cb != NULL) {
-		user_cb->cb_fn = cb_fn;
-		user_cb->cb_arg = cb_arg;
-		user_cb->event = event;
-		TAILQ_INSERT_TAIL(&(dev->link_intr_cbs), user_cb, next);
+		if (user_cb != NULL) {
+			user_cb->cb_fn = cb_fn;
+			user_cb->cb_arg = cb_arg;
+			user_cb->event = event;
+			TAILQ_INSERT_TAIL(&(dev->link_intr_cbs), user_cb, next);
+		}
 	}
 
 	rte_spinlock_unlock(&rte_eth_dev_cb_lock);
-- 
1.9.0



More information about the stable mailing list