Messages in this thread | | | Date | Wed, 17 Aug 2022 16:42:56 +0200 | From | David Sterba <> | Subject | Re: [PATCH] fs: btrfs: fix possible memory leaks in btrfs_get_dev_args_from_path() |
| |
On Mon, Aug 15, 2022 at 11:16:06PM +0800, Zixuan Fu wrote: > In btrfs_get_dev_args_from_path(), btrfs_get_bdev_and_sb() can fail if the > path is invalid. In this case, btrfs_get_dev_args_from_path() returns > directly without freeing args->uuid and args->fsid allocated before, which > causes memory leaks. > > To fix these possible leaks, when btrfs_get_bdev_and_sb() fails, > btrfs_put_dev_args_from_path() is called to clean up the memory. > > Fixes: faa775c41d655 ("btrfs: add a btrfs_get_dev_args_from_path helper") > Reported-by: TOTE Robot <oslab@tsinghua.edu.cn> > Signed-off-by: Zixuan Fu <r33s3n6@gmail.com>
Added to misc-next, thanks.
| |