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:
Pedro F. Giffuni 2016-05-13 14:59:02 +00:00
parent 40dbeed32b
commit 9f3dba686c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299676

View File

@ -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);
}