In function acm_ep_up(), when it fails to assign any name to an endpoint, the
endpoint in the provider is not properly closed before the core endpoint is
freed. This may cause segfault when ibacmp tries to join multicast group with
a stale core endpoint pointer.
Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
ret = acm_assign_ep_names(ep);
if (ret) {
acm_log(0, "ERROR - unable to assign EP name for pkey 0x%x\n", pkey);
- goto err;
+ goto ep_close;
}
DListInsertHead(&ep->entry, &port->ep_list);
return;
+ep_close:
+ port->prov->close_endpoint(ep->prov_ep_context);
+
err:
free(ep);
}