Skip to content

Commit 320fc82

Browse files
mdouchapevik
authored andcommitted
kvm_find_free_descriptor(): Skip descriptor 0
The GDT/LDT descriptor 0 should always be empty. Start search for free descriptor table entry at index 1. Link: https://lore.kernel.org/ltp/[email protected]/ Reviewed-by: Petr Vorel <[email protected]> Signed-off-by: Martin Doucha <[email protected]>
1 parent 29b76a9 commit 320fc82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

testcases/kernel/kvm/lib_x86.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ int kvm_find_free_descriptor(const struct segment_descriptor *table,
174174
const struct segment_descriptor *ptr;
175175
size_t i;
176176

177-
for (i = 0, ptr = table; i < size; i++, ptr++) {
177+
for (i = 1, ptr = table + 1; i < size; i++, ptr++) {
178178
if (!(ptr->flags_lo & SEGFLAG_PRESENT))
179179
return i;
180180

0 commit comments

Comments
 (0)