From patchwork Thu Dec 14 03:32:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gujjar, Abhinandan S" X-Patchwork-Id: 32258 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 06FC47CDC; Thu, 14 Dec 2017 10:02:25 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id A17AC2BCE for ; Thu, 14 Dec 2017 10:02:23 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Dec 2017 01:02:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,400,1508828400"; d="scan'208";a="2310498" Received: from unknown (HELO localhost.localdomain) ([10.224.122.195]) by fmsmga007.fm.intel.com with ESMTP; 14 Dec 2017 01:02:20 -0800 From: Abhinandan Gujjar To: thomas@monjalon.net Cc: dev@dpdk.org, abhinandan.gujjar@intel.com Date: Thu, 14 Dec 2017 09:02:23 +0530 Message-Id: <1513222343-79143-1-git-send-email-abhinandan.gujjar@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] ethdev: fix memory leaks in remove rxtx callbacks X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The patch frees memory allocated by add rxtx callbacks Signed-off-by: Abhinandan Gujjar --- lib/librte_ether/rte_ethdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 318af28..2ab6e05 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -3229,6 +3229,7 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, if (cb == user_cb) { /* Remove the user cb from the callback list. */ *prev_cb = cb->next; + rte_free(cb); ret = 0; break; } @@ -3263,6 +3264,7 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, if (cb == user_cb) { /* Remove the user cb from the callback list. */ *prev_cb = cb->next; + rte_free(cb); ret = 0; break; }