mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Avoid panic when c.PCIDs is nil
When PCID is disabled, there would throw a panic when dropPageTables() access to c.PCID without check. Signed-off-by: Lai Jiangshan <eag0628@gmail.com>
This commit is contained in:
committed by
Lai Jiangshan
parent
d057871f41
commit
fdfa05ff2c
@@ -90,7 +90,9 @@ func (m *machine) dropPageTables(pt *pagetables.PageTables) {
|
||||
|
||||
// Clear from all PCIDs.
|
||||
for _, c := range m.vCPUs {
|
||||
c.PCIDs.Drop(pt)
|
||||
if c.PCIDs != nil {
|
||||
c.PCIDs.Drop(pt)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,9 @@ func (m *machine) dropPageTables(pt *pagetables.PageTables) {
|
||||
|
||||
// Clear from all PCIDs.
|
||||
for _, c := range m.vCPUs {
|
||||
c.PCIDs.Drop(pt)
|
||||
if c.PCIDs != nil {
|
||||
c.PCIDs.Drop(pt)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user