From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from compass.polito.it (compass.polito.it [130.192.55.110]) by dpdk.org (Postfix) with ESMTP id 52E368DAC for ; Fri, 20 Nov 2015 19:24:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by compass.polito.it (Postfix) with ESMTP id 261121000EA; Fri, 20 Nov 2015 19:24:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= studenti.polito.it; h=references:in-reply-to:x-mailer:message-id :date:date:subject:subject:cc:to:from:from:received:received; s= y2k10; t=1448043867; bh=xxV1ocChqG+MPc+MSP8sgDSVUiJ73HnCK8sKsEUo 998=; b=e0j8CBkq+gzfLoHy0IQdVcjZ4nNoCOrkEGfQdEA++eIPc8QLm00M1rUn Pb9xIx8lHTojihZXa0vWK9QXUo5ssvoqNjD9OT+1q7EFWKKsBlLy7bgsck3wNYhA n/5rdzR7DKljwoo82F/DN/6OY/mvKnoXFMGS2BO+n3kKtIfc27M= X-Virus-Scanned: amavisd-new at studenti.polito.it Received: from compass.polito.it ([127.0.0.1]) by localhost (compass.polito.it [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id k5_rDDxNLtZx; Fri, 20 Nov 2015 19:24:27 +0100 (CET) Received: from localhost.localdomain (unknown [93.56.117.174]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: s203403@studenti.polito.it) by compass.polito.it (Postfix) with ESMTPSA id 2486E1000DB; Fri, 20 Nov 2015 19:24:27 +0100 (CET) From: Mauricio Vasquez B To: dev@dpdk.org Date: Fri, 20 Nov 2015 19:24:19 +0100 Message-Id: <1448043859-4326-1-git-send-email-mauricio.vasquezbernal@studenti.polito.it> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447885757-13038-1-git-send-email-mauricio.vasquezbernal@studenti.polito.it> References: <1447885757-13038-1-git-send-email-mauricio.vasquezbernal@studenti.polito.it> Subject: [dpdk-dev] [PATCH] ring: Fix memory leakage in rte_pmd_ring_devuninit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Nov 2015 18:24:28 -0000 When freeing the device it is also neccesary to free rx_queues and tx_queues Signed-off-by: Mauricio Vasquez B --- v2: Added extra control before freeing members of eth_dev->data drivers/net/ring/rte_eth_ring.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index 9a31bce..4ce0256 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -582,7 +582,12 @@ rte_pmd_ring_devuninit(const char *name) return -ENODEV; eth_dev_stop(eth_dev); - rte_free(eth_dev->data->dev_private); + + if(eth_dev->data) { + rte_free(eth_dev->data->rx_queues); + rte_free(eth_dev->data->tx_queues); + rte_free(eth_dev->data->dev_private); + } rte_free(eth_dev->data); rte_eth_dev_release_port(eth_dev); -- 1.9.1