Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4048454ybg; Sun, 7 Jun 2020 19:53:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBbC99WbZfyicCpKHuqYNtAvtO5B26F4xnwJHwBCN5AOrlkprA/hjEWqiXBKWJAB+Jsf8m X-Received: by 2002:a50:fb92:: with SMTP id e18mr19305452edq.135.1591584812234; Sun, 07 Jun 2020 19:53:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591584812; cv=none; d=google.com; s=arc-20160816; b=Q9MNZCb8F4MRiF+DZ13wLKH/oPk0bZ7avQDyUAkws0K6f33CLX5/U8iD6Bi2Uy5IBR gX3ge0nKy+T1TK+Ufc35SQibgj6vRTrmDSQ7uo8mH1HGVSgAUiWU9w5DLX8ZG31UP+B4 4aSGqQ/m1FnJ3AsNMmI4TuN/vRzvdf1SGnzPDgcnOy4YCkDjOSjlfdC4vZwp8HfD5B30 X7BE80y3ltrfT2ha3vZUj9pW1/NdBhqbJsHvTzgKa+NfOvgnb8JCLy+GPaBt33R7m5Sl 3lE9qMTfO50+9alvsQL+DXzOfzBRXc7bLHfGldFShSXx8wQAo9KOVef6nEIw6716rSjC pmVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=wkqkRXy6tAefLc7dY2jgT0K+gCwjzCp9GiJYQC7qRwo=; b=gNRBrNrynRwyi3SjAv634+HG1DleqkVUzUUR9NAo+3QwGorkQOtL0bUQOldzzoYxQ1 7zgBJNRjD/ABaQzamMLaNwk43wXCkPMlWBmXVRuGZEbFJ2sZJi38nB3uA8tln2e6DXRQ IvTFqicBa/wGwZEwAeIc7zaSbtT+yUSwTJROWaMxKBJ3CQapXhyhRGdpYwWazJi+fkwn GCYRUQ6Q7kBTWjAMKR25IdlFj/ot+fiDBGEeaMFGMT/ZAGT1e96qTni7SvrQM+K+bkap LRpo0E/CjA7pHBDQX6cNiew8d27CdzkOw+mYL+mxdaRxbF+oU56xu8/z1qE3Vc/u546h sKyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 g18si7365176ejk.282.2020.06.07.19.53.09; Sun, 07 Jun 2020 19:53:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728736AbgFHCvI (ORCPT + 99 others); Sun, 7 Jun 2020 22:51:08 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:58450 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728065AbgFHCvI (ORCPT ); Sun, 7 Jun 2020 22:51:08 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 684BB96EE16A14BE0FDD; Mon, 8 Jun 2020 10:51:06 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.202) with Microsoft SMTP Server (TLS) id 14.3.487.0; Mon, 8 Jun 2020 10:51:01 +0800 Subject: Re: [f2fs-dev] [PATCH 2/2] f2fs: use kfree() to free sbi in f2fs_fill_super() To: Denis Efremov , Jaegeuk Kim , "Chao Yu" CC: , References: <20200605181533.73113-1-efremov@linux.com> <20200605181533.73113-2-efremov@linux.com> From: Chao Yu Message-ID: Date: Mon, 8 Jun 2020 10:51:02 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200605181533.73113-2-efremov@linux.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/6/6 2:15, Denis Efremov wrote: > Use kfree() instead of kvfree() to free sbi in > f2fs_fill_super() because the memory is allocated with > kzalloc() in the function. Could you fix them in one patch? In addition, we need to fix them in f2fs_put_super() as well. Thanks, > > Fixes: 5222595d093e ("f2fs: use kvmalloc, if kmalloc is failed") > Signed-off-by: Denis Efremov > --- > fs/f2fs/super.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > index 9a3c8eba37e2..39b644c7e9d4 100644 > --- a/fs/f2fs/super.c > +++ b/fs/f2fs/super.c > @@ -3812,7 +3812,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) > free_sbi: > if (sbi->s_chksum_driver) > crypto_free_shash(sbi->s_chksum_driver); > - kvfree(sbi); > + kfree(sbi); > > /* give only one another chance */ > if (retry_cnt > 0 && skip_recovery) { >