From patchwork Mon Oct 24 03:31:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhijian Li (Fujitsu)" X-Patchwork-Id: 8147 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp235481wru; Sun, 23 Oct 2022 20:36:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5AYL5vRXb4wIzyh6mPL4gBkSyixXL71g1S0+LqHoEQt91RAcTKL2bgFwC3zRYu5QsE1rvL X-Received: by 2002:a17:907:3c81:b0:77a:327a:815f with SMTP id gl1-20020a1709073c8100b0077a327a815fmr26244752ejc.422.1666582588290; Sun, 23 Oct 2022 20:36:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666582588; cv=none; d=google.com; s=arc-20160816; b=f+diuvf3gI4sI9nIAQjBwJ0Ae204olvhTSoZNNs3lsnMYB3e5jX/BKs1Iw4pYTljxl yR2NAoGNgqLL/Bnr1vWgciiLZOiWF1UxSaeDL68bEG7S79NzrwQjTkdV9kLfCxJSxXzx 0SC6cSVTxJTcooIxFBaOlOvVfvCVVUnsc0MBERLhxYeFkFHJhPXVjdeBOOwcBTZZDQRT cuFESX7zQzmx/VncNTNZr94LpeczJTqUPDRQeosBxemq6PWXl7b+UzTL1In75B3EMzJ5 P2VxH0o6Rgb+LKIxln0bgDFiKCXpwb0iwCZtAJkp5rnB6HjbtC3kAUdaiDlKVdf65dde X8TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=gSj5HP5Q4BCk7l2MSunyvqKKrQUvd3/P7n/yyf89a9Y=; b=RtZjK2rn6h6+Hb5Gl2RIYsQ3i1/SzHscO+o44qKgjbxXHDkH1BcJ0r2poIZ5+sUw9D kMTlWvJBouvFXboaBjruTcrQSVLteDlnRsANS1x4paaRqny5rq8sffnwnD3FLee/32Ha Ic/e77rLUq/USAhTwtbNtnLyv6z+JJ9QSsYTOjhZYBndIU+od5SRtUi0FEtntCoY5qlW dCT+aNBgN0aSuOFx2cgmRbnGVlEutcur2B/fWrHb9fcPrX0v1msZrKRvBk4vKGDiQ9qB UwUG05W7+9WVNdCJr35qTIPtpyZkO2/kLS1qh9zpU2j8zt6pXdRyKzcin9FeZLXjJ7sY to5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fujitsu.com header.s=170520fj header.b="m425p0/9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l15-20020a170906794f00b0078d2a84f2f8si30450601ejo.645.2022.10.23.20.36.03; Sun, 23 Oct 2022 20:36:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fujitsu.com header.s=170520fj header.b="m425p0/9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229932AbiJXDc3 (ORCPT + 99 others); Sun, 23 Oct 2022 23:32:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229613AbiJXDcZ (ORCPT ); Sun, 23 Oct 2022 23:32:25 -0400 Received: from mail3.bemta32.messagelabs.com (mail3.bemta32.messagelabs.com [195.245.230.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08B1B5D0DF; Sun, 23 Oct 2022 20:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fujitsu.com; s=170520fj; t=1666582342; i=@fujitsu.com; bh=gSj5HP5Q4BCk7l2MSunyvqKKrQUvd3/P7n/yyf89a9Y=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=m425p0/9V+EZbQHP7bevmi9ascdTJBdgsFZBInngWkEwmJkE47/sKEWAqbcS3A4DS QOF0dp+7/iKQcRbw8iQCIMn5KZUiT83VJWx+Y0/qsnT2Mbevodc7yIXTGq1kgELJKD CW30i8bxrxp5TzikvE4EFxo/8cCbE/kxBriim4rg13EQcQsI+x1dpwFZjtiJddamyk gsxbAJigcIqq5XuVCtoDACADUs63gGLlH8rXUMJAIP5wzBQGqaEZk2UUH6qiOCDbxk BHK3dHGihmN+k3Nu6IVQN5Gg0K1f5AUksR96BFo32wo6aVAu0FIXO2w+c4eK7KRxNW qRMhJ/53pYVcw== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrAIsWRWlGSWpSXmKPExsViZ8MxSdeFPSz ZYOtuDouZM04wWkz5tZTZ4vKuOWwWzw71slh8mTqN2eL8sX52BzaPnbPusntsWtXJ5vF5k5zH 1s+3WQJYolgz85LyKxJYM071WRTM4qqY9JOzgXEyRxcjJ4eQwBZGif6Hhl2MXED2ciaJrW/Os 0E4Bxgl2hdNYgepYhPQkLjXcpMRxBYRiJH4d+wXmM0skCfx9c8uli5GDg5hAQ+JaXNEQUwWAV WJpgvOIBW8Ao4SbZMOgE2REFCQmPLwPTNEXFDi5MwnLBBTJCQOvnjBDNIqIaAkMbM7HqK8QmL WrDYmCFtN4uq5TcwTGPlnIemehaR7ASPTKkaz4tSistQiXUNTvaSizPSMktzEzBy9xCrdRL3U Ut3y1OISXUO9xPJivdTiYr3iytzknBS9vNSSTYzAgE4pZi/ewfhg2R+9Q4ySHExKorwr3gclC /El5adUZiQWZ8QXleakFh9ilOHgUJLgZf0amiwkWJSanlqRlpkDjC6YtAQHj5II7/2TQGne4o LE3OLMdIjUKUZFKXFeZrawZCEBkERGaR5cGyyiLzHKSgnzMjIwMAjxFKQW5WaWoMq/YhTnYFQ S5lVjBZrCk5lXAjf9FdBiJqDFl1YEgSwuSURISTUwJRnFLJr28oXYBFuFH6FXtvzMSO5ZVSzq c83367wsF8F33cn/P578FXtrdfjtJZfj7EPbfoctkDjvV7y/QkXDM+ZZnM7s9a0vV26XWeTJf HRzl8vkBe3fw868CbvjGeNps1+DXz763Bnv6V0RDa0/VwSqfFY4EqJy7O3ff4XlC+8Jvm+Ru+ e5rPhNrdHvR/ah3xl5jyYqya5ZfyQjlTd0jVHPw+NO2+rkWKdXSuet+/3+2OIV1/RTxF12Kvj 1Roh/TPnQlNiioHpCLj7cOojVfJN33btV09pvdzB19q069TcuTNmq2FtyS8k9cxGvXXffmoe4 mJyYI1AnnsPZGFt86M4m/Rbpk6c/xZa0H7+pxFKckWioxVxUnAgAFpSigGMDAAA= X-Env-Sender: lizhijian@fujitsu.com X-Msg-Ref: server-6.tower-585.messagelabs.com!1666582339!189538!1 X-Originating-IP: [62.60.8.146] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.100.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 25280 invoked from network); 24 Oct 2022 03:32:20 -0000 Received: from unknown (HELO n03ukasimr02.n03.fujitsu.local) (62.60.8.146) by server-6.tower-585.messagelabs.com with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 24 Oct 2022 03:32:20 -0000 Received: from n03ukasimr02.n03.fujitsu.local (localhost [127.0.0.1]) by n03ukasimr02.n03.fujitsu.local (Postfix) with ESMTP id B7F701000FB; Mon, 24 Oct 2022 04:32:19 +0100 (BST) Received: from R01UKEXCASM126.r01.fujitsu.local (R01UKEXCASM126 [10.183.43.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by n03ukasimr02.n03.fujitsu.local (Postfix) with ESMTPS id AA3E11000E9; Mon, 24 Oct 2022 04:32:19 +0100 (BST) Received: from e02445334835.localdomain (10.167.225.141) by R01UKEXCASM126.r01.fujitsu.local (10.183.43.178) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Mon, 24 Oct 2022 04:32:16 +0100 From: Li Zhijian To: , , , CC: , Li Zhijian , "Bob Pearson" Subject: [PATCH for-next v3 1/2] RDMA/rxe: Remove unnecessary mr testing Date: Mon, 24 Oct 2022 03:31:54 +0000 Message-ID: <1666582315-2-1-git-send-email-lizhijian@fujitsu.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.167.225.141] X-ClientProxiedBy: G08CNEXCHPEKD07.g08.fujitsu.local (10.167.33.80) To R01UKEXCASM126.r01.fujitsu.local (10.183.43.178) X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747283498511768639?= X-GMAIL-MSGID: =?utf-8?q?1747538504057701092?= Before the testing, we already passed it to rxe_mr_copy() where mr could be dereferenced. so this checking is not needed. The only way that mr is NULL is when it reaches below line 780 with 'qp->resp.mr = NULL', which is not possible in Bob's explanation[1]. 778 if (res->state == rdatm_res_state_new) { 779 if (!res->replay) { 780 mr = qp->resp.mr; 781 qp->resp.mr = NULL; 782 } else { [1] https://lore.kernel.org/lkml/30ff25c4-ce66-eac4-eaa2-64c0db203a19@gmail.com/ CC: Bob Pearson Signed-off-by: Li Zhijian Reviewed-by: Bob Pearson --- V3: remove WARN_ON # Yanjun and Bob --- drivers/infiniband/sw/rxe/rxe_resp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c index ed5a09e86417..b02639cf8cba 100644 --- a/drivers/infiniband/sw/rxe/rxe_resp.c +++ b/drivers/infiniband/sw/rxe/rxe_resp.c @@ -811,8 +811,7 @@ static enum resp_states read_reply(struct rxe_qp *qp, rxe_mr_copy(mr, res->read.va, payload_addr(&ack_pkt), payload, RXE_FROM_MR_OBJ); - if (mr) - rxe_put(mr); + rxe_put(mr); if (bth_pad(&ack_pkt)) { u8 *pad = payload_addr(&ack_pkt) + payload; From patchwork Mon Oct 24 05:20:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhijian Li (Fujitsu)" X-Patchwork-Id: 8162 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp262525wru; Sun, 23 Oct 2022 22:21:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6gCuCd+HVOj0MErv/rpuPTKjlOcZnybHHAGT/8XUxjGK1WIfURz5gYAStctmYCccSMShdo X-Received: by 2002:a17:903:4d7:b0:178:8564:f754 with SMTP id jm23-20020a17090304d700b001788564f754mr31907163plb.60.1666588888451; Sun, 23 Oct 2022 22:21:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666588888; cv=none; d=google.com; s=arc-20160816; b=i3KeAfiLNYKiqXld9vgewug4Tk5QxchUg1+m9I7kivMI5j1kdmT5q5L0D+gD4D9sAb RgRKdZjW3pfNxoMEZdO5OjMVvr5IUG1OjwKcKjSq3ExUulxfIeBfQ4Zkwc4a3+ErN2N+ S2ZJxKKO5QHpfEsmmf3leGH4eloarAi+ivpQg2KD5aKSrlu+TAoHL6kji1UN4RDnq+vj KSA77PLSLZd3xsblxkiyOJci+4G+phZjP4WvaARqmVJxNrQ8Z9Uk8JiFUYatBz8D6Y/n pSRw3vvR09ABjGFiJ2Moo/xkHV8Z6t0ZMsrfPb52y7yMtPyKiltj2x01LxqErqo9cmiT TGwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=duHcm8IBo78j4iAsKhiKhESqxQLZtSuJzRvKrU8wLaU=; b=q4RXJoxI7KRwJ/4EWLTNnN5MuRNGEaQdvVK2CScyI1rrnVlTsOkqCZikt/6eT3+YgQ X7F5WGcRKm06KYAT8/4wceC1CONZM8uYmK30lW8knPKkyARW/EDwkUBhQx7B8n5l5RkL WdK4R8exQRvWh54WBH9kWd9QH1Amma1XksNsa/SDWu45vcQczZtXOCaQV7bp3jJxfDpc 43twiR17uxoBIHqAK9az1O9fSkzgDIkWy2OiwvpWHyLcgGharYVaXW386pDzyiNObdyk q2jawZ4Wnhx81BLMOHaOU9WgQfShMeGbemyJssjqxNZ7rIFO+b5elwj4/03J5pEjBVCg HqQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a170902dad000b00177568a0e53si37734577plx.252.2022.10.23.22.21.12; Sun, 23 Oct 2022 22:21:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230138AbiJXFVK (ORCPT + 99 others); Mon, 24 Oct 2022 01:21:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbiJXFVJ (ORCPT ); Mon, 24 Oct 2022 01:21:09 -0400 Received: from esa11.hc1455-7.c3s2.iphmx.com (esa11.hc1455-7.c3s2.iphmx.com [207.54.90.137]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11F8C61D51; Sun, 23 Oct 2022 22:21:04 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6500,9779,10509"; a="72828002" X-IronPort-AV: E=Sophos;i="5.95,207,1661785200"; d="scan'208";a="72828002" Received: from unknown (HELO yto-r1.gw.nic.fujitsu.com) ([218.44.52.217]) by esa11.hc1455-7.c3s2.iphmx.com with ESMTP; 24 Oct 2022 14:21:03 +0900 Received: from yto-m3.gw.nic.fujitsu.com (yto-nat-yto-m3.gw.nic.fujitsu.com [192.168.83.66]) by yto-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id C80AFD66A3; Mon, 24 Oct 2022 14:21:01 +0900 (JST) Received: from kws-ab1.gw.nic.fujitsu.com (kws-ab1.gw.nic.fujitsu.com [192.51.206.11]) by yto-m3.gw.nic.fujitsu.com (Postfix) with ESMTP id E998FD9691; Mon, 24 Oct 2022 14:21:00 +0900 (JST) Received: from FNSTPC.g08.fujitsu.local (unknown [10.167.226.45]) by kws-ab1.gw.nic.fujitsu.com (Postfix) with ESMTP id EE42911403E8; Mon, 24 Oct 2022 14:20:59 +0900 (JST) From: Li Zhijian To: zyjzyj2000@gmail.com, jgg@ziepe.ca, leon@kernel.org, linux-rdma@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Li Zhijian , Bob Pearson Subject: [PATCH for-next v3 2/2] RDMA/rxe: Fix mr leak in RESPST_ERR_RNR Date: Mon, 24 Oct 2022 13:20:49 +0800 Message-Id: <20221024052049.20577-1-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <1666582315-2-1-git-send-email-lizhijian@fujitsu.com> References: <1666582315-2-1-git-send-email-lizhijian@fujitsu.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1408-9.0.0.1002-27220.005 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1408-9.0.1002-27220.005 X-TMASE-Result: 10-1.290000-10.000000 X-TMASE-MatchedRID: 1qs/xP9nRfnyAV/ow31xq+9kW9mxCQvtndls9F9zmi2jEIt+uIPPOIre 5xUTEbm3PnkLz0tiKhf4k1dYqOhY3WYeY1r5+Sd7hdD+G7U5X/Sc/8UYyRuho3uaPw9VMh5j0Bh ZSjgdIiQi+t+0AiFaYlDzs+ptu0k3pFPA9gan8yWRgPzABkqxIH0tCKdnhB58k4rY1r+vswgXvQ kGi3tjz46HM5rqDwqt0PlwXS+MTWJauV6otRbPX1WTJvU4HQmnuUl9W5PYcaBtb5mbBxcqYOuhV ACdVr98OBHWwUnqcG0h3LeAlyCOC9RSbtOqIybrFcG3+ZRETICP9kUX1Z+buE3LumkbQiNwVCqT SPu8tVR7AxIEOt4h2Q== X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747545110173165030?= X-GMAIL-MSGID: =?utf-8?q?1747545110173165030?= rxe_recheck_mr() will increase mr's ref_cnt, so we should call rxe_put(mr) to drop mr's ref_cnt in RESPST_ERR_RNR to avoid below warning: [ 633.447883] WARNING: CPU: 0 PID: 4156 at drivers/infiniband/sw/rxe/rxe_pool.c:259 __rxe_cleanup+0x1df/0x240 [rdma_rxe] ... [ 633.509482] Call Trace: [ 633.510246] [ 633.510962] rxe_dereg_mr+0x4c/0x60 [rdma_rxe] [ 633.512123] ib_dereg_mr_user+0xa8/0x200 [ib_core] [ 633.513444] ib_mr_pool_destroy+0x77/0xb0 [ib_core] [ 633.514763] nvme_rdma_destroy_queue_ib+0x89/0x240 [nvme_rdma] [ 633.516230] nvme_rdma_free_queue+0x40/0x50 [nvme_rdma] [ 633.517577] nvme_rdma_teardown_io_queues.part.0+0xc3/0x120 [nvme_rdma] [ 633.519204] nvme_rdma_error_recovery_work+0x4d/0xf0 [nvme_rdma] [ 633.520695] process_one_work+0x582/0xa40 [ 633.522987] ? pwq_dec_nr_in_flight+0x100/0x100 [ 633.524227] ? rwlock_bug.part.0+0x60/0x60 [ 633.525372] worker_thread+0x2a9/0x700 [ 633.526437] ? process_one_work+0xa40/0xa40 [ 633.527589] kthread+0x168/0x1a0 [ 633.528518] ? kthread_complete_and_exit+0x20/0x20 [ 633.529792] ret_from_fork+0x22/0x30 CC: Bob Pearson Fixes: 8a1a0be894da ("RDMA/rxe: Replace mr by rkey in responder resources") Signed-off-by: Li Zhijian V2: remove mr testing --- drivers/infiniband/sw/rxe/rxe_resp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c index b02639cf8cba..41250154a478 100644 --- a/drivers/infiniband/sw/rxe/rxe_resp.c +++ b/drivers/infiniband/sw/rxe/rxe_resp.c @@ -806,8 +806,10 @@ static enum resp_states read_reply(struct rxe_qp *qp, skb = prepare_ack_packet(qp, &ack_pkt, opcode, payload, res->cur_psn, AETH_ACK_UNLIMITED); - if (!skb) + if (!skb) { + rxe_put(mr); return RESPST_ERR_RNR; + } rxe_mr_copy(mr, res->read.va, payload_addr(&ack_pkt), payload, RXE_FROM_MR_OBJ);