[JFFS2] Fix oops when marking space dirty in scan, but no previous node exists.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/fs/jffs2/nodelist.c b/fs/jffs2/nodelist.c
index 5d36e9b..927dfe4 100644
--- a/fs/jffs2/nodelist.c
+++ b/fs/jffs2/nodelist.c
@@ -1139,7 +1139,7 @@
BUG();
}
/* REF_EMPTY_NODE is !obsolete, so that works OK */
- if (ref_obsolete(jeb->last_node)) {
+ if (jeb->last_node && ref_obsolete(jeb->last_node)) {
#ifdef TEST_TOTLEN
jeb->last_node->__totlen += size;
#endif