Linux-f2fs-devel Archive on lore.kernel.org
 help / color / Atom feed
* Re: [f2fs-dev] [PATCH] f2fs: use kfree() to free sbi->gc_thread allocated by f2fs_kmalloc
  2020-07-25  1:49 [f2fs-dev] [PATCH] f2fs: use kfree() to free sbi->gc_thread allocated by f2fs_kmalloc Jack Qiu
@ 2020-07-25  1:24 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2020-07-25  1:24 UTC (permalink / raw)
  To: Jack Qiu, linux-f2fs-devel

Hello,

Let's check and do conversion for all possible cases rather than do
one by one.

On 2020/7/25 9:49, Jack Qiu wrote:
> Use kfree() instead of kvfree() to free sbi->gc_thread allocated
> by f2fs_kmalloc(). Because the memory is allocated with kmalloc
> inside f2fs_kmalloc().
> 
> Signed-off-by: Jack Qiu <jack.qiu@huawei.com>
> ---
>   fs/f2fs/gc.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index 5b95d5a146eb..696ceeedc76d 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -147,7 +147,7 @@ int f2fs_start_gc_thread(struct f2fs_sb_info *sbi)
>   			"f2fs_gc-%u:%u", MAJOR(dev), MINOR(dev));
>   	if (IS_ERR(gc_th->f2fs_gc_task)) {
>   		err = PTR_ERR(gc_th->f2fs_gc_task);
> -		kvfree(gc_th);
> +		kfree(gc_th);
>   		sbi->gc_thread = NULL;
>   	}
>   out:
> @@ -160,7 +160,7 @@ void f2fs_stop_gc_thread(struct f2fs_sb_info *sbi)
>   	if (!gc_th)
>   		return;
>   	kthread_stop(gc_th->f2fs_gc_task);
> -	kvfree(gc_th);
> +	kfree(gc_th);
>   	sbi->gc_thread = NULL;
>   }
> 
> --
> 2.17.1
> 
> 
> 
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
> .
> 


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [f2fs-dev] [PATCH] f2fs: use kfree() to free sbi->gc_thread allocated by f2fs_kmalloc
@ 2020-07-25  1:49 Jack Qiu
  2020-07-25  1:24 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Jack Qiu @ 2020-07-25  1:49 UTC (permalink / raw)
  To: linux-f2fs-devel

Use kfree() instead of kvfree() to free sbi->gc_thread allocated
by f2fs_kmalloc(). Because the memory is allocated with kmalloc
inside f2fs_kmalloc().

Signed-off-by: Jack Qiu <jack.qiu@huawei.com>
---
 fs/f2fs/gc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 5b95d5a146eb..696ceeedc76d 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -147,7 +147,7 @@ int f2fs_start_gc_thread(struct f2fs_sb_info *sbi)
 			"f2fs_gc-%u:%u", MAJOR(dev), MINOR(dev));
 	if (IS_ERR(gc_th->f2fs_gc_task)) {
 		err = PTR_ERR(gc_th->f2fs_gc_task);
-		kvfree(gc_th);
+		kfree(gc_th);
 		sbi->gc_thread = NULL;
 	}
 out:
@@ -160,7 +160,7 @@ void f2fs_stop_gc_thread(struct f2fs_sb_info *sbi)
 	if (!gc_th)
 		return;
 	kthread_stop(gc_th->f2fs_gc_task);
-	kvfree(gc_th);
+	kfree(gc_th);
 	sbi->gc_thread = NULL;
 }

--
2.17.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-25  1:49 [f2fs-dev] [PATCH] f2fs: use kfree() to free sbi->gc_thread allocated by f2fs_kmalloc Jack Qiu
2020-07-25  1:24 ` Chao Yu

Linux-f2fs-devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-f2fs-devel/0 linux-f2fs-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-f2fs-devel linux-f2fs-devel/ https://lore.kernel.org/linux-f2fs-devel \
		linux-f2fs-devel@lists.sourceforge.net
	public-inbox-index linux-f2fs-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/net.sourceforge.lists.linux-f2fs-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git