Skip to contentSkip to conversation

fix NULL dereferencing in dcache.c

PATCH New Dan Aloni 1 participant 1 message May 31, 2002 VFS

lore
Share & tools
lore

Dan Aloni

author
#0 lore raw

PATCH 1/1 fix NULL dereferencing in dcache.c

Unrelated to my first dcache patch, this is something more crucial and should be applied first.

fs/dcache.c:
- handle d_alloc() returning NULL.

fs/dcache.c +3 -0
@@ -755,6 +755,9 @@
 	}
 
 	tmp = d_alloc(NULL, &(const struct qstr) {"",0,0});
+	if (!tmp)
+		return NULL;
+
 	tmp->d_parent = tmp; /* make sure dput doesn't croak */
 	
 	spin_lock(&dcache_lock);
Signature · 2 lines
Dan Aloni
[email protected]