summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAlexander Beregalov <a.beregalov@gmail.com>2010-02-22 17:17:44 +0300
committerSage Weil <sage@newdream.net>2010-02-23 14:26:34 -0800
commit4ce1e9adabbad8f2c45ceeeb6de56cc368484297 (patch)
tree960188ec419b55ecaa3288b3d54aa5e2fe481b02 /fs
parent5b3a4db3e4009aff918abb1353eb3f4925393a7b (diff)
downloadlinux-4ce1e9adabbad8f2c45ceeeb6de56cc368484297.tar.gz
linux-4ce1e9adabbad8f2c45ceeeb6de56cc368484297.tar.bz2
linux-4ce1e9adabbad8f2c45ceeeb6de56cc368484297.zip
ceph: move dereference after NULL test
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/addr.c4
1 files changed, 3 insertions, 1 deletions
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