[PATCH] fix NULL dereferencing in dcache.c

Dan Aloni (da-x@gmx.net)
Fri, 31 May 2002 19:32:19 +0300


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

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

--- linux-2.5.19/fs/dcache.c Thu May 30 22:35:37 2002
+++ linux-2.5.19/fs/dcache.c Fri May 31 19:19:18 2002
@@ -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);

-- 
Dan Aloni
da-x@gmx.net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/