Message ID | 1354627545-2792-1-git-send-email-tm@tao.ma |
---|---|
State | Superseded, archived |
Headers | show |
On Tue, Dec 04, 2012 at 09:25:45PM +0800, Tao Ma wrote: > Hi Dan, > Thanks for the report. Can you check whether this patch > works for you? > It looks good. Like I mentioned before Smatch doesn't understand ext4_has_inline_data() so it still complains later on in the function. But it's now obvious to a human reader that there won't be a NULL dereference. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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); - - } else { + } else if (page_bufs) { ret = ext4_walk_page_buffers(handle, page_bufs, 0, len, NULL, do_journal_get_write_access);