f2fs: use kfree() to free sbi->gc_thread allocated by f2fs_kmalloc
PATCH 1/1 f2fs: use kfree() to free sbi->gc_thread allocated by f2fs_kmalloc
Use kfree() instead of kvfree() to free sbi->gc_thread allocated by f2fs_kmalloc(). Because the memory is allocated with kmalloc inside f2fs_kmalloc().
--- fs/f2fs/gc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/f2fs/gc.c +2 -2
@@ -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
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Hello,
Let's check and do conversion for all possible cases rather than do one by one.
Quoted 36 lines · Jack Qiu
Use
kfree()instead ofkvfree()to freesbi->gc_threadallocated byf2fs_kmalloc(). Because the memory is allocated with kmalloc insidef2fs_kmalloc().Signed-off-by Jack Qiu <[email protected]>--- fs/f2fs/gc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/f2fs/gc.c +2
-3@@ -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
Quoted 6 lines
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
.
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel