Skip to content
Commit 04d21a24 authored by Ilya Dryomov's avatar Ilya Dryomov
Browse files

Btrfs: rework error handling in btrfs_mount()

Commits 6c41761f and 45ea6095

 introduced the possibility of NULL pointer
dereference on error paths, also we would leave all devices busy and
leak fs_info with all sub-structures on error when trying to mount an
already mounted fs to a different directory.

Fix this by doing all allocations before trying to open any of the
devices, adjust error path for mount-already-mounted-fs case.

Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 586e46e2
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment