We document the rule that return values >= 0 of functions are supposed
to indicate success, and that in case of success all return parameters
should be initialized. Let's actually do so.
Just a tiny coding style fix-up.
if (F_TYPE_EQUAL(sfs.f_type, BTRFS_SUPER_MAGIC))
return btrfs_get_block_device(path, dev);
+ *dev = 0;
return 0;
}
return -errno;
/* We won't do this for btrfs RAID */
- if (fsi.num_devices != 1)
+ if (fsi.num_devices != 1) {
+ *dev = 0;
return 0;
+ }
for (id = 1; id <= fsi.max_id; id++) {
struct btrfs_ioctl_dev_info_args di = {