lkml.org 
[lkml]   [2022]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] btrfs: Fix a memory leak in btrfs_ioctl_balance()
From
<snip>

>
> Actually to simplify further:
>
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 7a6974e877f4..bbda55d41a06 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -4353,6 +4353,7 @@ static long btrfs_ioctl_balance(struct file *file,
> void __user *arg)
>         bargs = memdup_user(arg, sizeof(*bargs));
>         if (IS_ERR(bargs)) {
>                 ret = PTR_ERR(bargs);
> +               bargs = NULL;
>                 goto out;
>         }

Unf, this also leads to the double free ...

<snip>

\
 
 \ /
  Last update: 2022-04-21 13:35    [W:0.076 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site