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>
This commit is contained in:
Juerg Haefliger 2017-10-04 04:24:41 -04:00 committed by Dave Kleikamp
parent 04d73f86e3
commit 88a96fa841
1 changed files with 2 additions and 0 deletions

View File

@ -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;