Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8601666rwb; Thu, 24 Nov 2022 01:37:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf7xtCjTufT6OmXcnuM7I6kJbITaMKb1h4Tl/Br73kkkDA7p1iCKjEku2z5f4K0X45EDLoQy X-Received: by 2002:aa7:980c:0:b0:574:80b6:5706 with SMTP id e12-20020aa7980c000000b0057480b65706mr3081387pfl.30.1669282670655; Thu, 24 Nov 2022 01:37:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669282670; cv=none; d=google.com; s=arc-20160816; b=uLw+t0+1/tIzZjVygxE5YvgADCOMtXJ7Hc2cLvcnAkZ5LxDrHovY/EvVxuXj2nPV/E kuEnVi0cq9jBiSCeLDoi8CUQQ2HoT9ZbHxw00xCl4bXYZjDQMhKKyp5Sd1z/+eH+sI6K Da3KRsly+N57GKcM1VJf/mrTCgwTbXYZrierCHeTEG4Wsb0Yx3ojr6txHWzh2RoJJo+S HO653Mbfgj904kpooIOIFuD+ihMgASVDESIGyOMODpIAcaywF9qV7TGPiKXwIFEefQPl W+C2urElpVOQxGIxA7IZDiPTEGBdP+AkaylJZtkXUrlB9A/xzioDb1IvJrC3HvFP8wlh XgUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from; bh=DbllPU4D61J1GhetVTtdL00hbFncofzII8byvxEgOP8=; b=E1UBY2WF1fJBT/aJPIfwp6brTB1MsoLu3fTHIqB06OPn4z5RBRR0My7ykTJ59joYHr 5Re2yfxUir+DohDpIXd5bNKQWYmA4Q3y31zcRvbA9teD6/gRBSm2hbT5PynCeNYBNxfc 8FU5g9Y6qE0JO8Uy++lML98fyh3qjOdRDJYryUp7/ACXu2yVTLEYBtUTpiwbhysYR4M9 Ahe86S+hhxbIJHyPkfqoN+pMI42udQ9viJomPyyJyyNQPypQ7tTYgcGoSq7kAhqbiv5Z CZAZ7ueNlnutdDlzb00xV1jeow7wdfy02YxDYUJ44NkGFULXS05XO48KlAzJqbHqtsQg Jb2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x69-20020a638648000000b0046f72960500si345031pgd.379.2022.11.24.01.37.32; Thu, 24 Nov 2022 01:37:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-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-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229486AbiKXJZd (ORCPT + 99 others); Thu, 24 Nov 2022 04:25:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbiKXJZc (ORCPT ); Thu, 24 Nov 2022 04:25:32 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF1F11165B8 for ; Thu, 24 Nov 2022 01:25:29 -0800 (PST) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NHsyv2VDpzmVNY; Thu, 24 Nov 2022 17:24:55 +0800 (CST) Received: from dggpemm500015.china.huawei.com (7.185.36.181) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 24 Nov 2022 17:25:28 +0800 Received: from huawei.com (10.175.103.91) by dggpemm500015.china.huawei.com (7.185.36.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 24 Nov 2022 17:25:27 +0800 From: Wang ShaoBo CC: , , , , Subject: [PATCH] SUNRPC: Fix missing release socket in rpc_sockname() Date: Thu, 24 Nov 2022 17:23:42 +0800 Message-ID: <20221124092342.3672933-1-bobo.shaobowang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500015.china.huawei.com (7.185.36.181) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org socket dynamically created is not released when getting an unintended address family type in rpc_sockname(), direct to out_release for calling sock_release(). Fixes: 2e738fdce22f ("SUNRPC: Add API to acquire source address") Signed-off-by: Wang ShaoBo --- net/sunrpc/clnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 993acf38af87..0b0b9f1eed46 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -1442,7 +1442,7 @@ static int rpc_sockname(struct net *net, struct sockaddr *sap, size_t salen, break; default: err = -EAFNOSUPPORT; - goto out; + goto out_release; } if (err < 0) { dprintk("RPC: can't bind UDP socket (%d)\n", err); -- 2.25.1