kernel: removed unreachable code in fault (CID: 155701)
If the user process does not have a segment holding the required addr the fault function return early.
This commit is contained in:
parent
55a8a84d8d
commit
e0e45fba5a
|
@ -45,7 +45,6 @@ fault(uintptr_t addr, uintptr_t pc, int ftype)
|
||||||
if(up->procctl == Proc_exitbig)
|
if(up->procctl == Proc_exitbig)
|
||||||
pexit("out of memory", 1);
|
pexit("out of memory", 1);
|
||||||
|
|
||||||
if(s != nil){
|
|
||||||
pprint("%s fault fail %s(%c%c%c) pid %d (%s) addr 0x%p pc 0x%p\n",
|
pprint("%s fault fail %s(%c%c%c) pid %d (%s) addr 0x%p pc 0x%p\n",
|
||||||
fault_types[ftype],
|
fault_types[ftype],
|
||||||
segment_types[s->type],
|
segment_types[s->type],
|
||||||
|
@ -53,11 +52,6 @@ fault(uintptr_t addr, uintptr_t pc, int ftype)
|
||||||
(s->permissions & SgWrite) != 0 ? 'w' : '-',
|
(s->permissions & SgWrite) != 0 ? 'w' : '-',
|
||||||
(s->permissions & SgExecute) != 0 ? 'x' : '-',
|
(s->permissions & SgExecute) != 0 ? 'x' : '-',
|
||||||
up->pid, up->text, faddr, pc);
|
up->pid, up->text, faddr, pc);
|
||||||
} else {
|
|
||||||
pprint("%s fault fail, no segment, pid %d (%s) addr 0x%p pc 0x%p\n",
|
|
||||||
fault_types[ftype],
|
|
||||||
up->pid, up->text, faddr, pc);
|
|
||||||
}
|
|
||||||
splhi();
|
splhi();
|
||||||
up->psstate = sps;
|
up->psstate = sps;
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue