From patchwork Mon Nov 7 08:51:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 13034080 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D962BC4332F for ; Mon, 7 Nov 2022 08:51:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231476AbiKGIv5 (ORCPT ); Mon, 7 Nov 2022 03:51:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231449AbiKGIvw (ORCPT ); Mon, 7 Nov 2022 03:51:52 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B74B15832 for ; Mon, 7 Nov 2022 00:51:51 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 22DD6B80E6A for ; Mon, 7 Nov 2022 08:51:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A284C433C1; Mon, 7 Nov 2022 08:51:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667811108; bh=Xm97nTTw9iBpkr85kFkbOLaoix4xkI1EJ8ctSlG9Kuc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NOLIOzr8qgKjfCPhQxuHnioy+Vl4NMbnI/7yTc9MVEd9WfCnP1U70ZGrjMPD4D2/1 /ugBflhT9Z7fBMaV/O50loBsaWvLlwsFGUdH6nVTevcpQ6xJKAUovppQzymhG4kMRP wOXju5iCw/DTgnjRkeRceMIySvqcZ1OBXt0L/icKS/ODUSrp6ZUvDTi0V9mJWhmwaW WQXy6AC3FzujhYdsQ/zKaUdm3CMASG9Jiw6Yz4+f5J0BEx9f15EFru8tw2kKh4TnA5 +Uh+Wa0QtKw4mfTi/IjZcIAmxmvuAlW6LShlzFuorqhkVS8XDgRjlO4UR9+0NqLqlv GN3MaepYXCvKg== From: Leon Romanovsky To: Jason Gunthorpe Cc: Mark Zhang , linux-rdma@vger.kernel.org, Michael Guralnik , Or Har-Toov Subject: [PATCH rdma-next 2/4] RDMA/restrack: Release MR restrack when delete Date: Mon, 7 Nov 2022 10:51:34 +0200 Message-Id: <703db18e8d4ef628691fb93980a709be673e62e3.1667810736.git.leonro@nvidia.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Mark Zhang The MR restrack also needs to be released when delete it, otherwise it cause memory leak as the task struct won't be released. Fixes: 13ef5539def7 ("RDMA/restrack: Count references to the verbs objects") Signed-off-by: Mark Zhang Reviewed-by: Michael Guralnik Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/restrack.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c index 1f935d9f6178..01a499a8b88d 100644 --- a/drivers/infiniband/core/restrack.c +++ b/drivers/infiniband/core/restrack.c @@ -343,8 +343,6 @@ void rdma_restrack_del(struct rdma_restrack_entry *res) rt = &dev->res[res->type]; old = xa_erase(&rt->xa, res->id); - if (res->type == RDMA_RESTRACK_MR) - return; WARN_ON(old != res); out: