Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31546
b: refs/heads/master
c: 4a45b7d
h: refs/heads/master
v: v3
  • Loading branch information
Bryan O'Sullivan authored and Linus Torvalds committed Jul 1, 2006
1 parent 6d6f554 commit 1f7b672
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6665ddee85bfc336d691ea5132a2c20a1d0e8053
refs/heads/master: 4a45b7d4ece0e6dc425e9f66fa8b501b72d846db
5 changes: 5 additions & 0 deletions trunk/drivers/infiniband/hw/ipath/ipath_mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ struct ib_mr *ipath_reg_user_mr(struct ib_pd *pd, struct ib_umem *region,
int n, m, i;
struct ib_mr *ret;

if (region->length == 0) {
ret = ERR_PTR(-EINVAL);
goto bail;
}

n = 0;
list_for_each_entry(chunk, &region->chunk_list, list)
n += chunk->nents;
Expand Down
8 changes: 8 additions & 0 deletions trunk/drivers/infiniband/hw/ipath/ipath_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,14 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
goto bail;
}

if (init_attr->cap.max_send_sge +
init_attr->cap.max_recv_sge +
init_attr->cap.max_send_wr +
init_attr->cap.max_recv_wr == 0) {
ret = ERR_PTR(-EINVAL);
goto bail;
}

switch (init_attr->qp_type) {
case IB_QPT_UC:
case IB_QPT_RC:
Expand Down
11 changes: 11 additions & 0 deletions trunk/drivers/infiniband/hw/ipath/ipath_verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,17 @@ static struct ib_ah *ipath_create_ah(struct ib_pd *pd,
goto bail;
}

if (ah_attr->dlid == 0) {
ret = ERR_PTR(-EINVAL);
goto bail;
}

if (ah_attr->port_num != 1 ||
ah_attr->port_num > pd->device->phys_port_cnt) {
ret = ERR_PTR(-EINVAL);
goto bail;
}

ah = kmalloc(sizeof *ah, GFP_ATOMIC);
if (!ah) {
ret = ERR_PTR(-ENOMEM);
Expand Down

0 comments on commit 1f7b672

Please sign in to comment.