We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fc5ebc commit b61e6afCopy full SHA for b61e6af
hypervisor/arch/x86/cpuid.c
@@ -91,12 +91,13 @@ static inline int set_vcpuid_entry(struct vm *vm,
91
struct vcpuid_entry *tmp;
92
size_t entry_size = sizeof(struct vcpuid_entry);
93
94
- tmp = &vm->vcpuid_entries[vm->vcpuid_entry_nr++];
95
- if (vm->vcpuid_entry_nr > MAX_VM_VCPUID_ENTRIES) {
+ if (vm->vcpuid_entry_nr == MAX_VM_VCPUID_ENTRIES) {
96
pr_err("%s, vcpuid entry over MAX_VM_VCPUID_ENTRIES(%d)\n",
97
__func__, MAX_VM_VCPUID_ENTRIES);
98
return -ENOMEM;
99
}
+
100
+ tmp = &vm->vcpuid_entries[vm->vcpuid_entry_nr++];
101
memcpy_s(tmp, entry_size, entry, entry_size);
102
return 0;
103
0 commit comments