From: Alexander Beregalov Date: Mon, 22 Feb 2010 14:17:44 +0000 (+0300) Subject: ceph: move dereference after NULL test X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4ce1e9adabbad8f2c45ceeeb6de56cc368484297;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git ceph: move dereference after NULL test Signed-off-by: Alexander Beregalov Signed-off-by: Sage Weil --- diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 25360d517d1b..23bb0ceabe31 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -144,7 +144,7 @@ static int ceph_set_page_dirty(struct page *page) */ static void ceph_invalidatepage(struct page *page, unsigned long offset) { - struct inode *inode = page->mapping->host; + struct inode *inode; struct ceph_inode_info *ci; struct ceph_snap_context *snapc = (void *)page->private; @@ -153,6 +153,8 @@ static void ceph_invalidatepage(struct page *page, unsigned long offset) BUG_ON(!PagePrivate(page)); BUG_ON(!page->mapping); + inode = page->mapping->host; + /* * We can get non-dirty pages here due to races between * set_page_dirty and truncate_complete_page; just spit out a