Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
authorLinus Torvalds <torvalds@g5.osdl.org>
Sat, 5 Nov 2005 00:31:54 +0000 (16:31 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 5 Nov 2005 00:31:54 +0000 (16:31 -0800)
1  2 
drivers/infiniband/hw/mthca/mthca_profile.c
drivers/infiniband/hw/mthca/mthca_qp.c

index bd1338682074bff3f01e3c7fd66945b57429e5a8,408cd551bff1be1f645401195123b76db1829b8f..08a909371b0a1060634526b53819314497fcd04a
@@@ -35,8 -35,6 +35,8 @@@
  
  #include <linux/module.h>
  #include <linux/moduleparam.h>
 +#include <linux/string.h>
 +#include <linux/slab.h>
  
  #include "mthca_profile.h"
  
@@@ -82,12 -80,10 +82,10 @@@ u64 mthca_make_profile(struct mthca_de
        struct mthca_resource tmp;
        int i, j;
  
-       profile = kmalloc(MTHCA_RES_NUM * sizeof *profile, GFP_KERNEL);
+       profile = kzalloc(MTHCA_RES_NUM * sizeof *profile, GFP_KERNEL);
        if (!profile)
                return -ENOMEM;
  
-       memset(profile, 0, MTHCA_RES_NUM * sizeof *profile);
        profile[MTHCA_RES_QP].size   = dev_lim->qpc_entry_sz;
        profile[MTHCA_RES_EEC].size  = dev_lim->eec_entry_sz;
        profile[MTHCA_RES_SRQ].size  = dev_lim->srq_entry_sz;
index 7c9afde5ace56ba73258a7d0505df408a45c7139,8b0b93565a256c7aa07bcb29294386a9a9c8a64a..8852ea477c2118425e6c84f287ddd4fcacf9071f
@@@ -36,8 -36,6 +36,8 @@@
   */
  
  #include <linux/init.h>
 +#include <linux/string.h>
 +#include <linux/slab.h>
  
  #include <rdma/ib_verbs.h>
  #include <rdma/ib_cache.h>
@@@ -584,6 -582,13 +584,13 @@@ int mthca_modify_qp(struct ib_qp *ibqp
                return -EINVAL;
        }
  
+       if ((attr_mask & IB_QP_PKEY_INDEX) && 
+            attr->pkey_index >= dev->limits.pkey_table_len) {
+               mthca_dbg(dev, "PKey index (%u) too large. max is %d\n",
+                         attr->pkey_index,dev->limits.pkey_table_len-1); 
+               return -EINVAL;
+       }
        mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL);
        if (IS_ERR(mailbox))
                return PTR_ERR(mailbox);