From: Namjae Jeon Date: Sat, 2 Feb 2013 14:52:42 +0000 (+0900) Subject: f2fs: mark gc_thread as NULL when thread creation is failed X-Git-Tag: MMI-PSA29.97-13-9~14941^2~7 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=25718423ea6f7118f9c173adff0fac52414571b8;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git f2fs: mark gc_thread as NULL when thread creation is failed When gc thread creation is failed, mark gc_thread as NULL to avoid crash while trying to stop invalid thread in stop_gc_thread->kthread_stop. Instead make it return from: if (!gc_th) return; Signed-off-by: Namjae Jeon Signed-off-by: Amit Sahrawat Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index b1e498503e59..16fdec355201 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -104,6 +104,7 @@ int start_gc_thread(struct f2fs_sb_info *sbi) "f2fs_gc-%u:%u", MAJOR(dev), MINOR(dev)); if (IS_ERR(gc_th->f2fs_gc_task)) { kfree(gc_th); + sbi->gc_thread = NULL; return -ENOMEM; } return 0;