mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-04 15:14:27 +00:00
hv:fix "missing for discarded return value" for memcpy_s and strcpy_s
It will print error information inside memcpy_s if
the parameteter is invalid, the caller can not check
the return value for memcpy_s/strcpy_s/strncpy_s
code like this:
int a(void) {
return 0;
}
int b(void){
a();
}
fix as follow:
int a(void) {
return 0;
}
int b(void){
(void)a();
}
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
This commit is contained in:
@@ -144,7 +144,7 @@ int64_t hcall_create_vm(struct vm *vm, uint64_t param)
|
||||
(void)memset(&vm_desc, 0, sizeof(vm_desc));
|
||||
vm_desc.sworld_enabled =
|
||||
(!!(cv.vm_flag & (SECURE_WORLD_ENABLED)));
|
||||
memcpy_s(&vm_desc.GUID[0], 16, &cv.GUID[0], 16);
|
||||
(void)memcpy_s(&vm_desc.GUID[0], 16, &cv.GUID[0], 16);
|
||||
ret = create_vm(&vm_desc, &target_vm);
|
||||
|
||||
if (ret != 0) {
|
||||
|
||||
Reference in New Issue
Block a user