aboutsummaryrefslogtreecommitdiffstats
path: root/lib/librte_eal/linuxapp/eal/eal_vfio.c
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2017-07-03 15:13:28 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2017-07-03 15:14:25 +0100
commit5c594d59c6927b6374fa59e16da3830507300321 (patch)
tree17ec0a2158cf2460e8f2ea3a1cf86ce87164e138 /lib/librte_eal/linuxapp/eal/eal_vfio.c
parent155502af1a45fa9474d56d4389dcba4e1e2c9f6d (diff)
parentbf7567fd2a5b0b28ab724046143c24561d38d015 (diff)
Merge 17.05.1 into 17.05.x
Change-Id: I65fdca844ad178ec6e2c086d45b901df93b55e58 Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'lib/librte_eal/linuxapp/eal/eal_vfio.c')
-rw-r--r--lib/librte_eal/linuxapp/eal/eal_vfio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index 53ac725d..946df7e3 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -189,7 +189,7 @@ vfio_group_device_get(int vfio_group_fd)
int i;
i = get_vfio_group_idx(vfio_group_fd);
- if (i < 0 || i > VFIO_MAX_GROUPS)
+ if (i < 0 || i > (VFIO_MAX_GROUPS - 1))
RTE_LOG(ERR, EAL, " wrong vfio_group index (%d)\n", i);
else
vfio_cfg.vfio_groups[i].devices++;
@@ -201,7 +201,7 @@ vfio_group_device_put(int vfio_group_fd)
int i;
i = get_vfio_group_idx(vfio_group_fd);
- if (i < 0 || i > VFIO_MAX_GROUPS)
+ if (i < 0 || i > (VFIO_MAX_GROUPS - 1))
RTE_LOG(ERR, EAL, " wrong vfio_group index (%d)\n", i);
else
vfio_cfg.vfio_groups[i].devices--;
@@ -213,7 +213,7 @@ vfio_group_device_count(int vfio_group_fd)
int i;
i = get_vfio_group_idx(vfio_group_fd);
- if (i < 0 || i > VFIO_MAX_GROUPS) {
+ if (i < 0 || i > (VFIO_MAX_GROUPS - 1)) {
RTE_LOG(ERR, EAL, " wrong vfio_group index (%d)\n", i);
return -1;
}