diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-08-25 14:24:37 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-09-22 18:22:34 -0400 |
commit | eae33d47a797e159306567643284a98ae7428ec4 (patch) | |
tree | 8a878a2e65f8a809d25c6c8ddd22c42073f7867c /drivers/infiniband | |
parent | 98341f261893acd7bc5abee5ddc35337ef49e457 (diff) |
IB/ipath: do not allow use of CQ entries with invalid counts
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_cq.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_cq.c b/drivers/infiniband/hw/ipath/ipath_cq.c index 3c4c198a4514..049221bc590e 100644 --- a/drivers/infiniband/hw/ipath/ipath_cq.c +++ b/drivers/infiniband/hw/ipath/ipath_cq.c | |||
@@ -172,7 +172,7 @@ struct ib_cq *ipath_create_cq(struct ib_device *ibdev, int entries, | |||
172 | struct ipath_cq_wc *wc; | 172 | struct ipath_cq_wc *wc; |
173 | struct ib_cq *ret; | 173 | struct ib_cq *ret; |
174 | 174 | ||
175 | if (entries > ib_ipath_max_cqes) { | 175 | if (entries < 1 || entries > ib_ipath_max_cqes) { |
176 | ret = ERR_PTR(-EINVAL); | 176 | ret = ERR_PTR(-EINVAL); |
177 | goto done; | 177 | goto done; |
178 | } | 178 | } |
@@ -324,6 +324,11 @@ int ipath_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata) | |||
324 | u32 head, tail, n; | 324 | u32 head, tail, n; |
325 | int ret; | 325 | int ret; |
326 | 326 | ||
327 | if (cqe < 1 || cqe > ib_ipath_max_cqes) { | ||
328 | ret = -EINVAL; | ||
329 | goto bail; | ||
330 | } | ||
331 | |||
327 | /* | 332 | /* |
328 | * Need to use vmalloc() if we want to support large #s of entries. | 333 | * Need to use vmalloc() if we want to support large #s of entries. |
329 | */ | 334 | */ |