* [PATCH] ext4: Fix a build warning in __ext4_journalled_writepage.
@ 2012-12-04 13:39 Tao Ma
0 siblings, 0 replies; only message in thread
From: Tao Ma @ 2012-12-04 13:39 UTC (permalink / raw)
To: linux-ext4; +Cc: Theodore Ts'o
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);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-12-04 13:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-04 13:39 [PATCH] ext4: Fix a build warning in __ext4_journalled_writepage Tao Ma
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).