diff options
Diffstat (limited to 'drivers/infiniband/hw/mlx4/srq.c')
-rw-r--r-- | drivers/infiniband/hw/mlx4/srq.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx4/srq.c b/drivers/infiniband/hw/mlx4/srq.c index 42ab4a801d6a..12fac1c8989d 100644 --- a/drivers/infiniband/hw/mlx4/srq.c +++ b/drivers/infiniband/hw/mlx4/srq.c | |||
@@ -297,6 +297,12 @@ int mlx4_ib_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr, | |||
297 | break; | 297 | break; |
298 | } | 298 | } |
299 | 299 | ||
300 | if (unlikely(srq->head == srq->tail)) { | ||
301 | err = -ENOMEM; | ||
302 | *bad_wr = wr; | ||
303 | break; | ||
304 | } | ||
305 | |||
300 | srq->wrid[srq->head] = wr->wr_id; | 306 | srq->wrid[srq->head] = wr->wr_id; |
301 | 307 | ||
302 | next = get_wqe(srq, srq->head); | 308 | next = get_wqe(srq, srq->head); |