Merge branch 'v4l_for_2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/mcheha...
[safe/jmp/linux-2.6] / net / rds / ib_cm.c
index 9d32069..f688327 100644 (file)
@@ -32,6 +32,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/in.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 
 #include "rds.h"
@@ -203,9 +204,10 @@ static void rds_ib_qp_event_handler(struct ib_event *event, void *data)
                rdma_notify(ic->i_cm_id, IB_EVENT_COMM_EST);
                break;
        default:
-               rds_ib_conn_error(conn, "RDS/IB: Fatal QP Event %u "
+               rdsdebug("Fatal QP Event %u "
                        "- connection %pI4->%pI4, reconnecting\n",
                        event->event, &conn->c_laddr, &conn->c_faddr);
+               rds_conn_drop(conn);
                break;
        }
 }
@@ -377,8 +379,8 @@ static u32 rds_ib_protocol_compatible(struct rdma_cm_event *event)
        }
 
        /* Even if len is crap *now* I still want to check it. -ASG */
-       if (event->param.conn.private_data_len < sizeof (*dp)
-           || dp->dp_protocol_major == 0)
+       if (event->param.conn.private_data_len < sizeof (*dp) ||
+           dp->dp_protocol_major == 0)
                return RDS_PROTOCOL_3_0;
 
        common = be16_to_cpu(dp->dp_protocol_minor_mask) & RDS_IB_SUPPORTED_PROTOCOLS;
@@ -473,6 +475,7 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id,
        err = rds_ib_setup_qp(conn);
        if (err) {
                rds_ib_conn_error(conn, "rds_ib_setup_qp failed (%d)\n", err);
+               mutex_unlock(&conn->c_cm_lock);
                goto out;
        }