From patchwork Sun Aug 5 15:35:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuval Shaia X-Patchwork-Id: 953541 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="EZPeaoS1"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41k4j408wVz9s5c for ; Mon, 6 Aug 2018 01:39:52 +1000 (AEST) Received: from localhost ([::1]:58993 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmL8H-0001V8-KD for incoming@patchwork.ozlabs.org; Sun, 05 Aug 2018 11:39:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmL4n-0007Bk-0B for qemu-devel@nongnu.org; Sun, 05 Aug 2018 11:36:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fmL4i-0006Si-4F for qemu-devel@nongnu.org; Sun, 05 Aug 2018 11:36:13 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:40364) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fmL4h-0006SX-R1 for qemu-devel@nongnu.org; Sun, 05 Aug 2018 11:36:08 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w75FYP0N149259; Sun, 5 Aug 2018 15:36:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=cySi7kbDzoFtVt/f+03n65cTMIMkK5xaYcxEW+1i6YY=; b=EZPeaoS1XPZfAn3V5FpfBDX45VhnWcqd/eYDJAIk9btI6e04y+0JV4EiUYA0Y4Ba7v1k ZYMPOXcQgvYsWIE4OrTtfKqxtjoU/S8gRfoIzPv6Z7SFY5VG5mDKZ56dieOE/ci6lzPd 5qNWbjj5aPjjsRZaA/b/NKUo7Mu0sJwUPbhWDcHMzBWuQGcckP870bFNHt/J1twuCOBi 16CNb7/gJt9OG363gkimTBKmDYn3hZKvnPU84WHhoErGRvbivArJ9m29/ZDwbE72s+KU p8nQ1qyDt7TCyOMTrS6HtCmeSESixHqcBHBaUESU0mM3wuz5aLyZgd/dLSgQZ9B19Y7I Kw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2kn1nctft5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 05 Aug 2018 15:36:04 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w75Fa4a3004928 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 5 Aug 2018 15:36:04 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w75Fa4BN003855; Sun, 5 Aug 2018 15:36:04 GMT Received: from localhost.localdomain (/77.138.186.148) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 05 Aug 2018 08:36:03 -0700 From: Yuval Shaia To: qemu-devel@nongnu.org, yuval.shaia@oracle.com, marcel.apfelbaum@gmail.com Date: Sun, 5 Aug 2018 18:35:13 +0300 Message-Id: <20180805153518.2983-9-yuval.shaia@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180805153518.2983-1-yuval.shaia@oracle.com> References: <20180805153518.2983-1-yuval.shaia@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8975 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=678 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808050173 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.79 Subject: [Qemu-devel] [PATCH v2 08/13] hw/rdma: Reorder resource cleanup X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" To be consistence with allocation do the reverse order in deallocation Signed-off-by: Yuval Shaia Reviewed-by: Marcel Apfelbaum --- hw/rdma/rdma_rm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/rdma/rdma_rm.c b/hw/rdma/rdma_rm.c index bf4a5c71b4..1f014b4ab2 100644 --- a/hw/rdma/rdma_rm.c +++ b/hw/rdma/rdma_rm.c @@ -543,8 +543,9 @@ void rdma_rm_fini(RdmaDeviceResources *dev_res) res_tbl_free(&dev_res->uc_tbl); res_tbl_free(&dev_res->cqe_ctx_tbl); res_tbl_free(&dev_res->qp_tbl); - res_tbl_free(&dev_res->cq_tbl); res_tbl_free(&dev_res->mr_tbl); + res_tbl_free(&dev_res->cq_tbl); res_tbl_free(&dev_res->pd_tbl); + g_hash_table_destroy(dev_res->qp_hash); }