diff options
author | Adrian Bunk <bunk@kernel.org> | 2007-11-15 02:00:02 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-15 03:45:42 +0100 |
commit | 8744969a819de4ee5158f4cdb30104601cc015d4 (patch) | |
tree | 3320c7eac5c3e15d3b17849f5afa1c0cbf1dc863 /fs | |
parent | fix mm/util.c:krealloc() (diff) | |
download | linux-8744969a819de4ee5158f4cdb30104601cc015d4.tar.xz linux-8744969a819de4ee5158f4cdb30104601cc015d4.zip |
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.c | 5 |
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; } |