1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvconvert: ensure device_name is defined

This commit is contained in:
Zdenek Kabelac 2021-01-22 21:45:05 +01:00
parent a9fd207192
commit 9fa4c099fb

View File

@ -4283,7 +4283,7 @@ static int _lv_create_cachevol(struct cmd_context *cmd,
char format[NAME_LEN]; char format[NAME_LEN];
struct dm_list *use_pvh; struct dm_list *use_pvh;
struct pv_list *pvl; struct pv_list *pvl;
char *device_name; const char *device_name = "";
struct device *dev_fast; struct device *dev_fast;
char *dev_argv[MAX_CACHEDEVS]; char *dev_argv[MAX_CACHEDEVS];
int dev_argc = 0; int dev_argc = 0;
@ -4317,7 +4317,7 @@ static int _lv_create_cachevol(struct cmd_context *cmd,
if (!grouped_arg_is_set(group->arg_values, cachedevice_ARG)) if (!grouped_arg_is_set(group->arg_values, cachedevice_ARG))
continue; continue;
if (!(device_name = (char *)grouped_arg_str_value(group->arg_values, cachedevice_ARG, NULL))) if (!(device_name = grouped_arg_str_value(group->arg_values, cachedevice_ARG, NULL)))
break; break;
if (device_name[0] == '@') { if (device_name[0] == '@') {
@ -4366,7 +4366,7 @@ static int _lv_create_cachevol(struct cmd_context *cmd,
return 0; return 0;
} }
dev_argv[dev_argc++] = device_name; dev_argv[dev_argc++] = (char*)device_name;
} }
if (!cache_size_sectors) if (!cache_size_sectors)