From: Adrian Bunk Date: Thu, 15 Nov 2007 01:00:02 +0000 (-0800) Subject: fuse_file_alloc(): fix NULL dereferences X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8744969a819de4ee5158f4cdb30104601cc015d4;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git fuse_file_alloc(): fix NULL dereferences Fix obvious NULL dereferences spotted by the Coverity checker. Signed-off-by: Adrian Bunk Acked-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 0fcdba9d47c0..535b37399009 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -55,9 +55,10 @@ struct fuse_file *fuse_file_alloc(void) if (!ff->reserved_req) { kfree(ff); ff = NULL; + } else { + INIT_LIST_HEAD(&ff->write_entry); + atomic_set(&ff->count, 0); } - INIT_LIST_HEAD(&ff->write_entry); - atomic_set(&ff->count, 0); } return ff; }