Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp931987pxv; Thu, 15 Jul 2021 20:20:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7O64FbFE1xJMX6KmsOyUEX93201zKDo7dXqVBMvEg3oNiX3ErbpZM5Y9+zzAyUD7EE0/s X-Received: by 2002:aa7:cfcf:: with SMTP id r15mr11543566edy.161.1626405632601; Thu, 15 Jul 2021 20:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626405632; cv=none; d=google.com; s=arc-20160816; b=TlaaWY/TLJK/EScrM4euT3mJby5Nb6KsN4Jddqy/37bdlddP+YWCOe2h4Ot0VreOhI ifUwauSPe5kW9VmSJ3EjtQ+ssYW1cBdTSX7yDm8YqUmFADJ363wHazmlB8GGPv4XvTTn fbVu986wCcFYGGP2LJo+bZap04sHfBOaKC0dWjzhmdCXkTofoJzbG1D17UE7HTC0TQ1l I2/cMOyJweb2bIF8VQqz2BGq3OQvU79NiU+LrKeRVssHP3EU0K3twZ2E+k9uY2zNwASu CjGxq0ll9s0OarzRewaurD7BzydLwJ1LQcEUezM0eRitKk+4oq2elUNfTVBbawb7VfyG XXEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=jj3bCaOiWmFOyGkNkz0CIPtNY0XO4GwKgEBojZ4+N24=; b=vLnjFG0TCtIG5RKWA5zjdR5Smhg1P35VFgDPr/0Hc2ePo0tfTSlLF0aVHpL6whpgSH pZOtPtVgQhXEQVJbinOeYrGB7KWDu/Cn9X3dKCM493EkxHJbpvvX/sjc/alyQaIXemzS J95hIErLXGNOvId0AU0CndBsvbWDer6jWBNR7OOo8S5vMqDwUBJ9O2wF23gDR4fOXV0+ ronYObLEDOCe5z0iieTSA4iQw/8/eDBmW2If/2YaluXVy2eYybngLNS5PnYYaolmNzdu Xl0Hs5X+gcPoFCggBQgdugEUzMMa92O3ZTPz72pvpjElWXWg+ctGph1Ez7ABdeJAerhL TUiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d24si9247952eds.184.2021.07.15.20.20.01; Thu, 15 Jul 2021 20:20:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233782AbhGPDWC (ORCPT + 99 others); Thu, 15 Jul 2021 23:22:02 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:36482 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233774AbhGPDWB (ORCPT ); Thu, 15 Jul 2021 23:22:01 -0400 Received: from callcc.thunk.org (96-65-121-81-static.hfc.comcastbusiness.net [96.65.121.81]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 16G3ILwr018133 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Jul 2021 23:18:22 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 325534202F5; Thu, 15 Jul 2021 23:18:21 -0400 (EDT) Date: Thu, 15 Jul 2021 23:18:21 -0400 From: "Theodore Y. Ts'o" To: wuguanghao Cc: linux-ext4@vger.kernel.org, artem.blagodarenko@gmail.com, liuzhiqiang26@huawei.com, linfeilong@huawei.com Subject: Re: [PATCH v2 01/12] profile_create_node: set magic before strdup(name) to avoid memory leak Message-ID: References: <20210630082724.50838-2-wuguanghao3@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210630082724.50838-2-wuguanghao3@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Jun 30, 2021 at 04:27:13PM +0800, wuguanghao wrote: > If new->magic != PROF_MAGIC_NODE, profile_free_node() don't free node. > This will cause the node to be unable to be released correctly and > a memory leak will occur. > > Signed-off-by: Wu Guanghao > Signed-off-by: Zhiqiang Liu > Reviewed-by: Wu Bo Applied, thanks. - Ted