From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id F05958D9C for ; Fri, 6 Nov 2015 18:28:42 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 06 Nov 2015 09:28:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,252,1444719600"; d="scan'208";a="813543672" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 06 Nov 2015 09:28:40 -0800 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id tA6HScFE012508; Fri, 6 Nov 2015 17:28:38 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id tA6HScUL007412; Fri, 6 Nov 2015 17:28:38 GMT Received: (from jmcnam2@localhost) by sivswdev02.ir.intel.com with id tA6HScO1007408; Fri, 6 Nov 2015 17:28:38 GMT From: John McNamara To: bruce.richardson@intel.com Date: Fri, 6 Nov 2015 17:28:37 +0000 Message-Id: <1446830917-7376-1-git-send-email-john.mcnamara@intel.com> X-Mailer: git-send-email 1.7.4.1 Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH] ring: fix minor memory free issue 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, 06 Nov 2015 17:28:43 -0000 Fix minor memory free issue in error clean-up. Reported-by Coverity (CID 119258) Signed-off-by: John McNamara --- drivers/net/ring/rte_eth_ring.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index cc60008..9a31bce 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -363,8 +363,10 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[], return data->port_id; error: - rte_free(data->rx_queues); - rte_free(data->tx_queues); + if (data) { + rte_free(data->rx_queues); + rte_free(data->tx_queues); + } rte_free(data); rte_free(internals); -- 1.8.1.4