[PATCH] Avoid passing uninitialized wbuf_dwork to cancel_delayed_work_sync during jffs2 sync.

Frank Mori Hess fmh6jj at gmail.com
Fri Nov 10 19:34:18 PST 2017


---
 fs/jffs2/super.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index 153f1c6eb169..4da67675e7ca 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -101,7 +101,8 @@ static int jffs2_sync_fs(struct super_block *sb, int wait)
 	struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
 
 #ifdef CONFIG_JFFS2_FS_WRITEBUFFER
-	cancel_delayed_work_sync(&c->wbuf_dwork);
+	if (c->wbuf != NULL)
+		cancel_delayed_work_sync(&c->wbuf_dwork);
 #endif
 
 	mutex_lock(&c->alloc_sem);
-- 
2.11.0





More information about the linux-mtd mailing list