summaryrefslogtreecommitdiffstats
path: root/fs/jfs
diff options
context:
space:
mode:
authorJuerg Haefliger <juerg.haefliger@canonical.com>2017-10-04 04:24:41 -0400
committerDave Kleikamp <dave.kleikamp@oracle.com>2017-11-02 09:46:50 -0500
commit88a96fa84186deadb8b1ecc8cb066cd7afeb5bf2 (patch)
tree3f428e5c755c7d0743e7117d1538709a3426ec06 /fs/jfs
parent04d73f86e35d41410ec55242b90330ec23dfe2b0 (diff)
downloadtalos-obmc-linux-88a96fa84186deadb8b1ecc8cb066cd7afeb5bf2.tar.gz
talos-obmc-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;
OpenPOWER on IntegriCloud