summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2007-11-15 04:00:02 +0300
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-15 05:45:42 +0300
commit8744969a819de4ee5158f4cdb30104601cc015d4 (patch)
tree3320c7eac5c3e15d3b17849f5afa1c0cbf1dc863 /fs
parentbe21f0ab0d8f10c90265066603a8d95b6037a6fa (diff)
downloadlinux-8744969a819de4ee5158f4cdb30104601cc015d4.tar.xz
fuse_file_alloc(): fix NULL dereferences
Fix obvious NULL dereferences spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@kernel.org> Acked-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/fuse/file.c5
1 files changed, 3 insertions, 2 deletions
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;
}