ovl: add NULL check in ovl_alloc_inode

This was detected by fault injection test

Signed-off-by: Hirofumi Nakagawa <nklabs@gmail.com>
Fixes: 13cf199d00 ("ovl: allocate an ovl_inode struct")
Cc: <stable@vger.kernel.org> # v4.13
This commit is contained in:
Hirofumi Nakagawa 2017-09-26 03:09:53 +09:00 committed by Miklos Szeredi
parent 33d930e59a
commit b3885bd6ed
1 changed files with 3 additions and 0 deletions

View File

@ -174,6 +174,9 @@ static struct inode *ovl_alloc_inode(struct super_block *sb)
{
struct ovl_inode *oi = kmem_cache_alloc(ovl_inode_cachep, GFP_KERNEL);
if (!oi)
return NULL;
oi->cache = NULL;
oi->redirect = NULL;
oi->version = 0;