Message ID | 20200310092545.251365-3-leon@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Jason Gunthorpe |
Headers | show |
Series | Fix locking around cm_id.state in the ib_cm | expand |
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index b1fccbf6ebd8..67b36b8b34ba 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -1185,7 +1185,8 @@ struct ib_cm_id *ib_cm_insert_listen(struct ib_device *device, /* Find an existing ID */ cm_id_priv = cm_find_listen(device, service_id); if (cm_id_priv) { - if (cm_id->cm_handler != cm_handler || cm_id->context) { + if (cm_id_priv->id.cm_handler != cm_handler || + cm_id_priv->id.context) { /* Sharing an ib_cm_id with different handlers is not * supported */ spin_unlock_irqrestore(&cm.lock, flags);