pandora: defconfig: update
[pandora-kernel.git] / net / rds / iw.c
index 5a9676f..5899356 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/if_arp.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
+#include <linux/module.h>
 
 #include "rds.h"
 #include "iw.h"
@@ -226,7 +227,7 @@ static int rds_iw_laddr_check(__be32 addr)
        /* Create a CMA ID and try to bind it. This catches both
         * IB and iWARP capable NICs.
         */
-       cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP);
+       cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP, IB_QPT_RC);
        if (IS_ERR(cm_id))
                return PTR_ERR(cm_id);
 
@@ -238,7 +239,8 @@ static int rds_iw_laddr_check(__be32 addr)
        ret = rdma_bind_addr(cm_id, (struct sockaddr *)&sin);
        /* due to this, we will claim to support IB devices unless we
           check node_type. */
-       if (ret || cm_id->device->node_type != RDMA_NODE_RNIC)
+       if (ret || !cm_id->device ||
+           cm_id->device->node_type != RDMA_NODE_RNIC)
                ret = -EADDRNOTAVAIL;
 
        rdsdebug("addr %pI4 ret %d node type %d\n",