[PATCH] fix NULL dereferencing in dcache.c

From: Dan Aloni (da-x@gmx.net)
Date: Fri May 31 2002 - 11:32:19 EST


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/



This archive was generated by hypermail 2b29 : Fri May 31 2002 - 22:00:31 EST