ibcore: Fix memory leak in cm_req_handler error flows.
In the cm_req_handler() error flows, sometimes cm_id_priv->timewait_info isn't free'd. Linux commit: 8b00914654ef56ff5473f4fe1f1168254dbb8a17 MFC after: 1 week Reviewed by: kib Sponsored by: Mellanox Technologies // NVIDIA Networking
This commit is contained in:
parent
f48e85dfe2
commit
2f05418748
@ -1790,8 +1790,7 @@ static int cm_req_handler(struct cm_work *work)
|
||||
listen_cm_id_priv = cm_match_req(work, cm_id_priv);
|
||||
if (!listen_cm_id_priv) {
|
||||
ret = -EINVAL;
|
||||
kfree(cm_id_priv->timewait_info);
|
||||
goto destroy;
|
||||
goto free_timeinfo;
|
||||
}
|
||||
|
||||
cm_id_priv->id.cm_handler = listen_cm_id_priv->id.cm_handler;
|
||||
@ -1866,6 +1865,8 @@ static int cm_req_handler(struct cm_work *work)
|
||||
rejected:
|
||||
atomic_dec(&cm_id_priv->refcount);
|
||||
cm_deref_id(listen_cm_id_priv);
|
||||
free_timeinfo:
|
||||
kfree(cm_id_priv->timewait_info);
|
||||
destroy:
|
||||
ib_destroy_cm_id(cm_id);
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user