Commit 8744969a authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds

fuse_file_alloc(): fix NULL dereferences

Fix obvious NULL dereferences spotted by the Coverity checker.
Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
Acked-by: default avatarMiklos Szeredi <miklos@szeredi.hu>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent be21f0ab
...@@ -55,10 +55,11 @@ struct fuse_file *fuse_file_alloc(void) ...@@ -55,10 +55,11 @@ struct fuse_file *fuse_file_alloc(void)
if (!ff->reserved_req) { if (!ff->reserved_req) {
kfree(ff); kfree(ff);
ff = NULL; ff = NULL;
} } else {
INIT_LIST_HEAD(&ff->write_entry); INIT_LIST_HEAD(&ff->write_entry);
atomic_set(&ff->count, 0); atomic_set(&ff->count, 0);
} }
}
return ff; return ff;
} }
......
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