From patchwork Wed Sep 28 03:49:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luo Meng X-Patchwork-Id: 12991564 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 E7A26C32771 for ; Wed, 28 Sep 2022 03:27:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230038AbiI1D1V (ORCPT ); Tue, 27 Sep 2022 23:27:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232391AbiI1D1S (ORCPT ); Tue, 27 Sep 2022 23:27:18 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6EC8AA36A for ; Tue, 27 Sep 2022 20:27:08 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4Mchgx46PszKH86 for ; Wed, 28 Sep 2022 11:25:01 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP2 (Coremail) with SMTP id Syh0CgDXKXMFvzNjkW4JBg--.8336S4; Wed, 28 Sep 2022 11:27:06 +0800 (CST) From: Luo Meng To: sfrench@samba.org, stable@kernel.org Cc: linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, lsahlber@redhat.com, luomeng12@huawei.com, luomeng@huaweicloud.com Subject: [PATCH 4.19] Revert "cifs: fix double free race when mount fails in cifs_get_root()" Date: Wed, 28 Sep 2022 11:49:07 +0800 Message-Id: <20220928034907.3194114-1-luomeng@huaweicloud.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CM-TRANSID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6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org From: Luo Meng This reverts commit 2fe0e281f7ad0a62259649764228227dd6b2561d. Commit 2fe0e281f7ad (cifs: fix double free race when mount fails in cifs_get_root()) fixes a double. However there is no such issue on 4.19 because it will return after cifs_cleanup_volume_info(). Since merge this patch, cifs_cleanup_volume_info() is skipped, leading to a memory leak. Signed-off-by: Luo Meng --- fs/cifs/cifsfs.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 52b1524b40cd..7dce6d1fa50b 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -779,7 +779,6 @@ cifs_smb3_do_mount(struct file_system_type *fs_type, out_super: deactivate_locked_super(sb); - return root; out: cifs_cleanup_volume_info(volume_info); return root;