From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 48B912BA4 for ; Wed, 15 Feb 2017 07:24:56 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2017 22:24:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,164,1484035200"; d="scan'208";a="1094927521" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by orsmga001.jf.intel.com with ESMTP; 14 Feb 2017 22:24:54 -0800 From: Yuanhan Liu To: Alan Dewar Cc: Yuanhan Liu , Jan Blunck , Cristian Dumitrescu , dpdk stable Date: Wed, 15 Feb 2017 14:26:28 +0800 Message-Id: <1487140012-13314-16-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1487140012-13314-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1487140012-13314-1-git-send-email-yuanhan.liu@linux.intel.com> Subject: [dpdk-stable] patch 'sched: fix crash when freeing port' has been queued to stable release 16.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 06:24:56 -0000 Hi, FYI, your patch has been queued to stable release 16.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/18/17. So please shout if anyone has objections. Thanks. --yliu --- >>From bfc65d9c21c61be041dc4704759fa29c4bc68594 Mon Sep 17 00:00:00 2001 From: Alan Dewar Date: Mon, 6 Feb 2017 18:32:42 +0100 Subject: [PATCH] sched: fix crash when freeing port [ upstream commit 3b780b9e9e9221725abbad9820704d05d7d2805e ] Prevent a segmentation fault in rte_sched_port_free by only accessing the port structure after the NULL pointer check has been made. Fixes: 7b3c4f35 ("sched: fix releasing enqueued packets") Signed-off-by: Alan Dewar Signed-off-by: Jan Blunck Acked-by: Cristian Dumitrescu --- lib/librte_sched/rte_sched.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c index e6dace2..614705d 100644 --- a/lib/librte_sched/rte_sched.c +++ b/lib/librte_sched/rte_sched.c @@ -735,12 +735,14 @@ void rte_sched_port_free(struct rte_sched_port *port) { uint32_t qindex; - uint32_t n_queues_per_port = rte_sched_port_queues_per_port(port); + uint32_t n_queues_per_port; /* Check user parameters */ if (port == NULL) return; + n_queues_per_port = rte_sched_port_queues_per_port(port); + /* Free enqueued mbufs */ for (qindex = 0; qindex < n_queues_per_port; qindex++) { struct rte_mbuf **mbufs = rte_sched_port_qbase(port, qindex); -- 1.9.0