Fix probing cache device in casadm

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski 2021-01-21 12:45:17 -06:00
parent 1fb5fd9662
commit 1fcb175fee

View File

@ -2849,6 +2849,11 @@ int _check_cache_device(const char *device_path,
{ {
int result, fd; int result, fd;
if (strncpy_s(cmd_info->path_name, sizeof(cmd_info->path_name),
device_path, MAX_STR_LEN)) {
return FAILURE;
}
fd = open_ctrl_device(); fd = open_ctrl_device();
if (fd == -1) if (fd == -1)
return FAILURE; return FAILURE;
@ -2857,7 +2862,7 @@ int _check_cache_device(const char *device_path,
close(fd); close(fd);
return result; return result ? FAILURE : SUCCESS;
} }
int check_cache_device(const char *device_path) int check_cache_device(const char *device_path)