summaryrefslogtreecommitdiffstats
path: root/fs/jfs
diff options
context:
space:
mode:
authorJuerg Haefliger <juerg.haefliger@canonical.com>2017-10-04 10:24:41 +0200
committerDave Kleikamp <dave.kleikamp@oracle.com>2017-11-02 15:46:50 +0100
commit88a96fa84186deadb8b1ecc8cb066cd7afeb5bf2 (patch)
tree3f428e5c755c7d0743e7117d1538709a3426ec06 /fs/jfs
parentjfs: remove increment of i_version counter (diff)
downloadlinux-88a96fa84186deadb8b1ecc8cb066cd7afeb5bf2.tar.xz
linux-88a96fa84186deadb8b1ecc8cb066cd7afeb5bf2.zip
jfs: Add missing NULL pointer check in __get_metapage
alloc_metapage can return a NULL pointer so check for that. Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com> Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Diffstat (limited to 'fs/jfs')
-rw-r--r--fs/jfs/jfs_metapage.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index 1c4b9ad4d7ab..1a3b0cc22ad3 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -663,6 +663,8 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
} else {
INCREMENT(mpStat.pagealloc);
mp = alloc_metapage(GFP_NOFS);
+ if (!mp)
+ goto unlock;
mp->page = page;
mp->sb = inode->i_sb;
mp->flag = 0;