diff options
author | Juerg Haefliger <juerg.haefliger@canonical.com> | 2017-10-04 11:24:41 +0300 |
---|---|---|
committer | Dave Kleikamp <dave.kleikamp@oracle.com> | 2017-11-02 17:46:50 +0300 |
commit | 88a96fa84186deadb8b1ecc8cb066cd7afeb5bf2 (patch) | |
tree | 3f428e5c755c7d0743e7117d1538709a3426ec06 /fs/jfs | |
parent | 04d73f86e35d41410ec55242b90330ec23dfe2b0 (diff) | |
download | linux-88a96fa84186deadb8b1ecc8cb066cd7afeb5bf2.tar.xz |
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.c | 2 |
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; |