/*
@@ -637,8 +632,11 @@ static void btrfs_free_stale_device(struct btrfs_device *cur_dev)
* either use mapper or non mapper path throughout.
*/
rcu_read_lock();
- not_found = strcmp(rcu_str_deref(dev->name),
- rcu_str_deref(cur_dev->name));
+ if (cur_dev)
+ not_found = strcmp(rcu_str_deref(dev->name),
+ rcu_str_deref(cur_dev->name));
+ else
+ not_found = 0;
nit: Perhaps put a proper documentation header at the beginning of the
function detailing this behavior. I.e.
/*
* btrfs_free_stale_device
* ....
Right. Will add.
Thanks, Anand
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html