Skip to content
Snippets Groups Projects
Commit c331efd0 authored by Dan Carpenter's avatar Dan Carpenter Committed by Tom Rini
Browse files

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: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarMarek Behún <kabel@kernel.org>
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
parent d8ac619a
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment