mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
fs: btrfs: volumes.c: Fix for possible null pointer dereference
commit 8321cf2596
upstream.
There is otherwise a risk of a possible null pointer dereference.
Was largely found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a25ebe2112
commit
8f1dd63b01
1 changed files with 3 additions and 2 deletions
|
@ -1446,11 +1446,12 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
|
|||
struct btrfs_fs_devices *fs_devices;
|
||||
fs_devices = root->fs_info->fs_devices;
|
||||
while (fs_devices) {
|
||||
if (fs_devices->seed == cur_devices)
|
||||
if (fs_devices->seed == cur_devices) {
|
||||
fs_devices->seed = cur_devices->seed;
|
||||
break;
|
||||
}
|
||||
fs_devices = fs_devices->seed;
|
||||
}
|
||||
fs_devices->seed = cur_devices->seed;
|
||||
cur_devices->seed = NULL;
|
||||
lock_chunks(root);
|
||||
__btrfs_close_devices(cur_devices);
|
||||
|
|
Loading…
Reference in a new issue