Commit c4023a9c authored by Dan Aloni's avatar Dan Aloni Committed by Linus Torvalds

[PATCH] 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.
parent ba047f41
...@@ -755,6 +755,9 @@ struct dentry * d_alloc_anon(struct inode *inode) ...@@ -755,6 +755,9 @@ struct dentry * d_alloc_anon(struct inode *inode)
} }
tmp = d_alloc(NULL, &(const struct qstr) {"",0,0}); tmp = d_alloc(NULL, &(const struct qstr) {"",0,0});
if (!tmp)
return NULL;
tmp->d_parent = tmp; /* make sure dput doesn't croak */ tmp->d_parent = tmp; /* make sure dput doesn't croak */
spin_lock(&dcache_lock); spin_lock(&dcache_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment