* [PATCH] ovl: add NULL check in ovl_alloc_inode
@ 2017-09-25 18:09 Hirofumi Nakagawa
2017-09-26 4:06 ` Amir Goldstein
0 siblings, 1 reply; 2+ messages in thread
From: Hirofumi Nakagawa @ 2017-09-25 18:09 UTC (permalink / raw)
To: linux-unionfs, miklos; +Cc: Hirofumi Nakagawa
This was detected by fault injection test
Signed-off-by: Hirofumi Nakagawa <nklabs@gmail.com>
---
fs/overlayfs/super.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index fd5ea4facc62..701aa2f3536d 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -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;
--
2.14.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ovl: add NULL check in ovl_alloc_inode
2017-09-25 18:09 [PATCH] ovl: add NULL check in ovl_alloc_inode Hirofumi Nakagawa
@ 2017-09-26 4:06 ` Amir Goldstein
0 siblings, 0 replies; 2+ messages in thread
From: Amir Goldstein @ 2017-09-26 4:06 UTC (permalink / raw)
To: Hirofumi Nakagawa; +Cc: overlayfs, Miklos Szeredi, stable [v4.13]
On Mon, Sep 25, 2017 at 9:09 PM, Hirofumi Nakagawa <nklabs@gmail.com> wrote:
> This was detected by fault injection test
>
> Signed-off-by: Hirofumi Nakagawa <nklabs@gmail.com>
Fixes: 13cf199d0088 ("ovl: allocate an ovl_inode struct")
Cc: <stable@vger.kernel.org> # v4.13
> ---
> fs/overlayfs/super.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
> index fd5ea4facc62..701aa2f3536d 100644
> --- a/fs/overlayfs/super.c
> +++ b/fs/overlayfs/super.c
> @@ -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;
> --
> 2.14.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-26 4:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-25 18:09 [PATCH] ovl: add NULL check in ovl_alloc_inode Hirofumi Nakagawa
2017-09-26 4:06 ` Amir Goldstein
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox