All of lore.kernel.org
 help / color / mirror / 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 related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-25  1:24 UTC | newest]

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.