From: Adrian Bunk <bunk@kernel.org>
To: miklos@szeredi.hu
Cc: fuse-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: [2.6 patch] fuse_file_alloc(): fix NULL dereferences
Date: Fri, 19 Oct 2007 16:05:18 +0200 [thread overview]
Message-ID: <20071019140518.GE3778@stusta.de> (raw)
This patch fixes obvious NULL dereferences spotted by the Coverity
checker.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
---
53b7c67ef9b6c26a0c7f554fef43021633a48ab7
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 0fcdba9..535b373 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;
}
next reply other threads:[~2007-10-19 14:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-19 14:05 Adrian Bunk [this message]
2007-10-19 14:14 ` Miklos Szeredi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071019140518.GE3778@stusta.de \
--to=bunk@kernel.org \
--cc=fuse-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®