|
@@ -699,7 +699,8 @@ static noinline int device_list_add(const char *path,
|
|
* if there is new btrfs on an already registered device,
|
|
* if there is new btrfs on an already registered device,
|
|
* then remove the stale device entry.
|
|
* then remove the stale device entry.
|
|
*/
|
|
*/
|
|
- btrfs_free_stale_device(device);
|
|
|
|
|
|
+ if (ret > 0)
|
|
|
|
+ btrfs_free_stale_device(device);
|
|
|
|
|
|
*fs_devices_ret = fs_devices;
|
|
*fs_devices_ret = fs_devices;
|
|
|
|
|