mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:37:35 +00:00
Kernel: Replace incorrect loop condition in write_raw_gdt_entry
Contradictory to the comment above it, this while loop was actually clearing the selectors above or equal to the edited one (instead of the selectors that were skipped when the gdt was extended), this wasn't really an issue so far, as all calls to this function did extend the GDT, which meant this condition was always false, but future calls to this function that will try to edit an existing entry would fail.
This commit is contained in:
parent
e424e3b88c
commit
f0b82c4b17
1 changed files with 3 additions and 4 deletions
|
@ -461,10 +461,9 @@ void Processor::write_raw_gdt_entry(u16 selector, u32 low, u32 high)
|
|||
m_gdt[i].high = high;
|
||||
|
||||
// clear selectors we may have skipped
|
||||
while (i < prev_gdt_length) {
|
||||
m_gdt[i].low = 0;
|
||||
m_gdt[i].high = 0;
|
||||
i++;
|
||||
for (auto j = prev_gdt_length; j < i; ++j) {
|
||||
m_gdt[j].low = 0;
|
||||
m_gdt[j].high = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue