From: Tao Ma <tm@tao.ma>
To: linux-ext4@vger.kernel.org
Cc: "Theodore Ts'o" <tytso@mit.edu>
Subject: [PATCH] ext4: Fix a build warning in __ext4_journalled_writepage.
Date: Tue, 4 Dec 2012 21:39:38 +0800 [thread overview]
Message-ID: <1354628379-3047-1-git-send-email-tm@tao.ma> (raw)
From: Tao Ma <boyu.mt@taobao.com>
smatch complains:
fs/ext4/inode.c:1953 __ext4_journalled_writepage() error: potential NULL dereference 'page_bufs'.
So add the check for it.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Tao Ma <boyu.mt@taobao.com>
---
fs/ext4/inode.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index dbc5784..431201b 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1956,7 +1956,7 @@ static int __ext4_journalled_writepage(struct page *page,
struct buffer_head *page_bufs = NULL;
handle_t *handle = NULL;
int ret = 0;
- int err;
+ int err = 0;
struct buffer_head *inode_bh = NULL;
ClearPageChecked(page);
@@ -1987,8 +1987,7 @@ static int __ext4_journalled_writepage(struct page *page,
ret = ext4_journal_get_write_access(handle, inode_bh);
err = ext4_handle_dirty_metadata(handle, inode, inode_bh);
reply other threads:[~2012-12-04 13:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1354628379-3047-1-git-send-email-tm@tao.ma \
--to=tm@tao.ma \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).