[PATCH] xfs: fix a memory leak in xfs_get_acl on error

Andreas Gruenbacher agruenba at redhat.com
Wed Mar 30 17:13:51 CDT 2016


On Wed, Mar 30, 2016 at 4:35 PM, Mateusz Guzik <mguzik at redhat.com> wrote:
> Signed-off-by: Mateusz Guzik <mguzik at redhat.com>

Reviewed-by: Andreas Gruenbacher <agruenba at redhat.com>

> ---
>  fs/xfs/xfs_acl.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
> index 2dad2b5..ce10c4c 100644
> --- a/fs/xfs/xfs_acl.c
> +++ b/fs/xfs/xfs_acl.c
> @@ -162,10 +162,11 @@ xfs_get_acl(struct inode *inode, int type)
>                  */
>                 if (error != -ENOATTR)
>                         acl = ERR_PTR(error);
> -               return acl;
> +               goto out;
>         }
>
>         acl = xfs_acl_from_disk(xfs_acl, len, XFS_ACL_MAX_ENTRIES(ip->i_mount));
> +out:
>         kmem_free(xfs_acl);
>         return acl;
>  }
> --
> 1.8.3.1
>



More information about the xfs mailing list