diff options
author | pfg <pfg@FreeBSD.org> | 2016-05-13 14:59:02 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-05-13 14:59:02 +0000 |
commit | bce9419fd5e64e75081bba663eb5a134994ebe8b (patch) | |
tree | 0f57e4cdb5994326538cb1bd16da85f67263d553 /usr.sbin | |
parent | cbeaac92d155e204177c4731c1c907ab739980cd (diff) | |
download | FreeBSD-src-bce9419fd5e64e75081bba663eb5a134994ebe8b.zip FreeBSD-src-bce9419fd5e64e75081bba663eb5a134994ebe8b.tar.gz |
bhyve: consider the bogus case of a negative bar idx.
This is a followup to r297472 to squelch Coverity.
CID: 1194319
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bhyve/pci_emul.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c index 1e45bad..523d7b0 100644 --- a/usr.sbin/bhyve/pci_emul.c +++ b/usr.sbin/bhyve/pci_emul.c @@ -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); } |