Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3115594pxm; Mon, 28 Feb 2022 12:20:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHoPZyUF65pcILrR/b6MeIKz/J1Nuk4UJFMAFoE0mw+0b6scCglSyNXiY90Ew/HiWQKqk4 X-Received: by 2002:aa7:9735:0:b0:4bd:b258:e872 with SMTP id k21-20020aa79735000000b004bdb258e872mr23338584pfg.46.1646079637374; Mon, 28 Feb 2022 12:20:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646079637; cv=none; d=google.com; s=arc-20160816; b=pkTMFBdFSYsGwKdhs8QbpHuZcFh410sUhr5v/naGTkMAbZ4/pB9CaHE/tYHss5JDea H6FEShT+/jRXLabAEbMP1FWACVHi0TT9pXjV4bo8xB8PNwE2FsnBFy07lsQ4ftZuWxgz XOlfL9JetPTZY4Na3rQRpqg2w1vJBG10J/n+BS7Zc8vS0geGTtsmQBV4XAWG9TnULQts hqGVFcGOX3luCD05hNP3cyt2eh1kh8MsLAdexF3cfmqHyvtecz4had/Qi+BDYC0Es60y sBb781sB1Qjm3/5Mm8R20vnuF9ghDAAk8tN2pD0p54oHKie8WjGMtVb/J0SMX6WLm8O2 5Vag== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6k2vZg+VSpArPezJv3S7R3dKrsPIvdP2SdGrsGWGk6w=; b=JCVnaJiJlr+nJ3IG+uMg9o9paF9rhAVsUJomy26VwzxSAkiFOHquaNwtB+qkf9emqQ mkxSuN1QDQpAk1o13UYdgUAxmfJiG5HCR0fgvjp0UdiFLJ9LB7p+9lfwP+gpodKjvyNO cdudRYSlCJ8rmAuKOt7wziE+ZsVa+oAwehxIGd1vjAss0hPPSf+E+Ud1lyF23TKwOJC0 y7uPDQDg7mfluVPVHEe8gA9jZBJFenUnDzMwG9xAe5gKz48qP+x5mrowKj/W5xu35DLg fpYMxKNP18HUPwhjjgB3EnQpKO2u5LcPykRyZmmd+pPFbLJgT60qnCH0c8Cl5IJSGVbY kByg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pqZ4Ywfm; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id r138-20020a632b90000000b00364c646b08csi9815518pgr.184.2022.02.28.12.20.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:20:37 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pqZ4Ywfm; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 79560190B55; Mon, 28 Feb 2022 11:40:52 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239388AbiB1R5u (ORCPT + 99 others); Mon, 28 Feb 2022 12:57:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240286AbiB1RyK (ORCPT ); Mon, 28 Feb 2022 12:54:10 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90751986F3; Mon, 28 Feb 2022 09:41:59 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 1F14F6153C; Mon, 28 Feb 2022 17:41:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FE8EC340E7; Mon, 28 Feb 2022 17:41:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646070110; bh=XF1c6l+ZV+WORH4b/vACdr35+2Do/8pE/ilyF5icJuo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pqZ4YwfmtkbaZ4f7xNtKJxBgn3CE1sZbKgoySFy6CMt9VDyYjJJAQaQgoqtVwjeVt oQdHx8NxICu9OiKdQt5BimzNoXFeCkJ7pFQoCSrQRnAK2z4DW5R/qjmSERmbbEusQt vxrURP2WMDkZQxv6Gq7ydbMsmU1VDt3ESwQpMh2I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Md Haris Iqbal , Jack Wang , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.15 090/139] RDMA/rtrs-clt: Move free_permit from free_clt to rtrs_clt_close Date: Mon, 28 Feb 2022 18:24:24 +0100 Message-Id: <20220228172357.092149071@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172347.614588246@linuxfoundation.org> References: <20220228172347.614588246@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Md Haris Iqbal [ Upstream commit c46fa8911b17e3f808679061a8af8bee219f4602 ] Error path of rtrs_clt_open() calls free_clt(), where free_permit is called. This is wrong since error path of rtrs_clt_open() does not need to call free_permit(). Also, moving free_permits() call to rtrs_clt_close(), makes it more aligned with the call to alloc_permit() in rtrs_clt_open(). Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality") Link: https://lore.kernel.org/r/20220217030929.323849-2-haris.iqbal@ionos.com Signed-off-by: Md Haris Iqbal Reviewed-by: Jack Wang Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/ulp/rtrs/rtrs-clt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c index 3272514f05405..a23438bacf12c 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c @@ -2753,7 +2753,6 @@ static struct rtrs_clt *alloc_clt(const char *sessname, size_t paths_num, static void free_clt(struct rtrs_clt *clt) { - free_permits(clt); free_percpu(clt->pcpu_path); /* @@ -2869,6 +2868,7 @@ void rtrs_clt_close(struct rtrs_clt *clt) rtrs_clt_destroy_sess_files(sess, NULL); kobject_put(&sess->kobj); } + free_permits(clt); free_clt(clt); } EXPORT_SYMBOL(rtrs_clt_close); -- 2.34.1