Avoid passing uninitialized wbuf_dwork to cancel_delayed_work_sync during jffs2 sync.

Message ID 5a06748e.2b1ac80a.cc211.e761@mx.google.com
State New
Delegated to: David Woodhouse
Headers show
Series
  • Avoid passing uninitialized wbuf_dwork to cancel_delayed_work_sync during jffs2 sync.
Related show

Commit Message

Frank Mori Hess Nov. 11, 2017, 3:34 a.m.
---
 fs/jffs2/super.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

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);