projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branches 'cma', 'cxgb4', 'flowsteer', 'ipoib', 'misc', 'mlx4', 'mlx5', 'nes...
[cascardo/linux.git]
/
drivers
/
infiniband
/
hw
/
mlx4
/
cq.c
diff --git
a/drivers/infiniband/hw/mlx4/cq.c
b/drivers/infiniband/hw/mlx4/cq.c
index
d5e60f4
..
66dbf80
100644
(file)
--- a/
drivers/infiniband/hw/mlx4/cq.c
+++ b/
drivers/infiniband/hw/mlx4/cq.c
@@
-324,7
+324,7
@@
static int mlx4_ib_get_outstanding_cqes(struct mlx4_ib_cq *cq)
u32 i;
i = cq->mcq.cons_index;
u32 i;
i = cq->mcq.cons_index;
- while (get_sw_cqe(cq, i
& cq->ibcq.cqe
))
+ while (get_sw_cqe(cq, i))
++i;
return i - cq->mcq.cons_index;
++i;
return i - cq->mcq.cons_index;
@@
-365,7
+365,7
@@
int mlx4_ib_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata)
mutex_lock(&cq->resize_mutex);
mutex_lock(&cq->resize_mutex);
- if (entries < 1
|| entries > dev->dev->caps.max_cqes
) {
+ if (entries < 1) {
err = -EINVAL;
goto out;
}
err = -EINVAL;
goto out;
}
@@
-376,6
+376,11
@@
int mlx4_ib_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata)
goto out;
}
goto out;
}
+ if (entries > dev->dev->caps.max_cqes) {
+ err = -EINVAL;
+ goto out;
+ }
+
if (ibcq->uobject) {
err = mlx4_alloc_resize_umem(dev, cq, entries, udata);
if (err)
if (ibcq->uobject) {
err = mlx4_alloc_resize_umem(dev, cq, entries, udata);
if (err)