Skip to content

Commit

Permalink
ovl: add NULL check in ovl_alloc_inode
Browse files Browse the repository at this point in the history
This was detected by fault injection test

Signed-off-by: Hirofumi Nakagawa <[email protected]>
Fixes: 13cf199 ("ovl: allocate an ovl_inode struct")
Cc: <[email protected]> # v4.13
  • Loading branch information
hnakagawa authored and Miklos Szeredi committed Oct 19, 2017
1 parent 33d930e commit b3885bd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/overlayfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b3885bd

Please sign in to comment.