bhyve: consider the bogus case of a negative bar idx.
This is a followup to r297472 to squelch Coverity. CID: 1194319
This commit is contained in:
parent
40dbeed32b
commit
9f3dba686c
@ -2034,7 +2034,7 @@ pci_emul_diow(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx,
|
||||
*/
|
||||
}
|
||||
|
||||
if (baridx > 2) {
|
||||
if (baridx > 2 || baridx < 0) {
|
||||
printf("diow: unknown bar idx %d\n", baridx);
|
||||
}
|
||||
}
|
||||
@ -2089,7 +2089,7 @@ pci_emul_dior(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx,
|
||||
}
|
||||
|
||||
|
||||
if (baridx > 2) {
|
||||
if (baridx > 2 || baridx < 0) {
|
||||
printf("dior: unknown bar idx %d\n", baridx);
|
||||
return (0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user