diff options
author | Jack Morgenstein <jackm@mellanox.co.il> | 2006-03-20 17:32:43 +0200 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-03-24 15:47:28 -0800 |
commit | d4301e2c6685c87206f24f54969120b182119ab0 (patch) | |
tree | 64cd469cae71b04ec426ee2b14289a53bb9c9f9f /drivers/infiniband/hw | |
parent | ded9ad721d220d47989177076a181ae1f1b93af5 (diff) | |
download | blackbird-op-linux-d4301e2c6685c87206f24f54969120b182119ab0.tar.gz blackbird-op-linux-d4301e2c6685c87206f24f54969120b182119ab0.zip |
IB/mthca: Check SRQ limit in modify SRQ operation
When setting the shared receive queue (SRQ) watermark in a modify SRQ
operation, make sure that the supplied value is not larger than the
full size of the SRQ.
Signed-off-by: Jack Morgenstein <jackm@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_srq.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c index 4e671e00e42b..0cfd15802217 100644 --- a/drivers/infiniband/hw/mthca/mthca_srq.c +++ b/drivers/infiniband/hw/mthca/mthca_srq.c @@ -358,6 +358,8 @@ int mthca_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr, return -EINVAL; if (attr_mask & IB_SRQ_LIMIT) { + if (attr->srq_limit > srq->max) + return -EINVAL; ret = mthca_ARM_SRQ(dev, srq->srqn, attr->srq_limit, &status); if (ret) return ret; |