commit | 078dacb5cfaf689fb3e885d3791b8b15dde94db8 | [log] [tgz] |
---|---|---|
author | Dan Carpenter <dan.carpenter@linaro.org> | Wed Jul 26 09:59:04 2023 +0300 |
committer | Tom Rini <trini@konsulko.com> | Tue Aug 08 17:05:43 2023 -0400 |
tree | 406d397a264ad31bee75b899e4ea2581a4f94574 | |
parent | 8fb3cf1666506b1259d2742ab8e63b93700be95d [diff] |
fs: btrfs: Prevent error pointer dereference in list_subvolums() If btrfs_read_fs_root() fails with -ENOENT, then we go to the next entry. Fine. But if it fails for a different reason then we need to clean up and return an error code. In the current code it doesn't clean up but instead dereferences "root" and crashes. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Marek BehĂșn <kabel@kernel.org> Reviewed-by: Qu Wenruo <wqu@suse.com>