From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id C701847D0 for ; Mon, 27 Jun 2016 14:34:44 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 27 Jun 2016 05:34:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,536,1459839600"; d="scan'208";a="995802842" Received: from sie-lab-212-116.ir.intel.com (HELO silpixa00378492.ir.intel.com) ([10.237.212.116]) by fmsmga001.fm.intel.com with ESMTP; 27 Jun 2016 05:34:41 -0700 From: Pablo de Lara To: dev@dpdk.org Cc: Pablo de Lara Date: Mon, 27 Jun 2016 13:41:27 +0100 Message-Id: <1467031287-30182-1-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.5.0 Subject: [dpdk-dev] [PATCH] app/test: avoid freeing mbufs twice in qat test 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: Mon, 27 Jun 2016 12:34:45 -0000 Test_multi_session was freeing mbufs used in the multiple sessions created and setting obuf to NULL after it, but ibuf was not being set to NULL, and therefore, it was being freed again (ibuf and obuf are pointing at the same address), in the ut_teardown() function. Fixes: 1b9cb73ecef1 ("app/test: fix qat autotest failure") Signed-off-by: Pablo de Lara --- app/test/test_cryptodev.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 67608ff..9dfe34f 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -3471,12 +3471,19 @@ test_multi_session(void) /* * free mbuf - both obuf and ibuf are usually the same, - * but rte copes even if we call free twice + * so check if they point at the same address is necessary, + * to avoid freeing the mbuf twice. */ if (ut_params->obuf) { rte_pktmbuf_free(ut_params->obuf); + if (ut_params->ibuf == ut_params->obuf) + ut_params->ibuf = 0; ut_params->obuf = 0; } + if (ut_params->ibuf) { + rte_pktmbuf_free(ut_params->ibuf); + ut_params->ibuf = 0; + } } /* Next session create should fail */ -- 2.5.0