Re: [PATCH] ovl: add NULL check in ovl_alloc_inode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 25, 2017 at 9:09 PM, Hirofumi Nakagawa <nklabs@xxxxxxxxx> wrote:
> This was detected by fault injection test
>
> Signed-off-by: Hirofumi Nakagawa <nklabs@xxxxxxxxx>

Fixes: 13cf199d0088 ("ovl: allocate an ovl_inode struct")
Cc: <stable@xxxxxxxxxxxxxxx> # 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@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]