diff mbox series

[04/11] btrfs-progs: NULL initialize device name for missing

Message ID 035575319ab5d70795697847c39453580d581c51.1688724045.git.anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: fix bugs and CHANGING_FSID_V2 flag | expand

Commit Message

Anand Jain July 7, 2023, 3:52 p.m. UTC
When we add an entry for the  missing device it has no device name,
set the btrfs_device::name parameter to NULL.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 kernel-shared/volumes.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/kernel-shared/volumes.c b/kernel-shared/volumes.c
index 671396dba689..4a8c559d4b20 100644
--- a/kernel-shared/volumes.c
+++ b/kernel-shared/volumes.c
@@ -2082,6 +2082,7 @@  static struct btrfs_device *fill_missing_device(u64 devid, u8 *uuid)
 	struct btrfs_device *device;
 
 	device = kzalloc(sizeof(*device), GFP_NOFS);
+	device->name = NULL;
 	device->devid = devid;
 	memcpy(device->uuid, uuid, BTRFS_UUID_SIZE);
 	device->fd = -1;
@@ -2257,6 +2258,7 @@  static int read_one_dev(struct btrfs_fs_info *fs_info,
 		device = kzalloc(sizeof(*device), GFP_NOFS);
 		if (!device)
 			return -ENOMEM;
+		device->name = NULL;
 		device->fd = -1;
 		list_add(&device->dev_list,
 			 &fs_info->fs_devices->devices);