diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-07-01 04:35:55 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-01 09:55:59 -0700 |
commit | 4a45b7d4ece0e6dc425e9f66fa8b501b72d846db (patch) | |
tree | 6e858b3343ffb3670eb6f5a838479d52791e0a30 /drivers/infiniband/hw/ipath/ipath_mr.c | |
parent | 6665ddee85bfc336d691ea5132a2c20a1d0e8053 (diff) | |
download | op-kernel-dev-4a45b7d4ece0e6dc425e9f66fa8b501b72d846db.zip op-kernel-dev-4a45b7d4ece0e6dc425e9f66fa8b501b72d846db.tar.gz |
[PATCH] IB/ipath: don't allow resources to be created with illegal values
Signed-off-by: Robert Walsh <robert.walsh@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_mr.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_mr.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_mr.c b/drivers/infiniband/hw/ipath/ipath_mr.c index 3093676..4ac31a5 100644 --- a/drivers/infiniband/hw/ipath/ipath_mr.c +++ b/drivers/infiniband/hw/ipath/ipath_mr.c @@ -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, ®ion->chunk_list, list) n += chunk->nents; |