lkml.org 
[lkml]   [2017]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4.13 16/43] ovl: add NULL check in ovl_alloc_inode
Date
4.13-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hirofumi Nakagawa <nklabs@gmail.com>

commit b3885bd6edb41b91a0e3976469f72ae31bfb8d95 upstream.

This was detected by fault injection test

Signed-off-by: Hirofumi Nakagawa <nklabs@gmail.com>
Fixes: 13cf199d0088 ("ovl: allocate an ovl_inode struct")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
fs/overlayfs/super.c | 3 +++
1 file changed, 3 insertions(+)

--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -174,6 +174,9 @@ static struct inode *ovl_alloc_inode(str
{
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;

\
 
 \ /
  Last update: 2017-10-31 11:11    [W:0.276 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site