Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d76c3a72 authored by Samantha Tran's avatar Samantha Tran
Browse files

disp: msm: dp: add operation to free the mst port object



Add a release operation to free the mst port object when
the object refcount becomes zero.

Change-Id: If628e6da7ccf90d334574ed0f627788fb0a1fa2f
Signed-off-by: default avatarSamantha Tran <samtran@codeaurora.org>
parent e6933ff2
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -152,6 +152,13 @@ struct dp_mst_encoder_info_cache {
struct dp_mst_private dp_mst;
struct dp_mst_encoder_info_cache dp_mst_enc_cache;

static void dp_mst_sim_destroy_port(struct kref *ref)
{
	struct drm_dp_mst_port *port = container_of(ref,
			struct drm_dp_mst_port, kref);
	kfree(port);
}

/* DRM DP MST Framework simulator OPs */
static void dp_mst_sim_add_port(struct dp_mst_private *mst,
			struct dp_mst_sim_port_data *port_msg)
@@ -196,13 +203,14 @@ static void dp_mst_sim_add_port(struct dp_mst_private *mst,
			mutex_lock(&mstb->mgr->lock);
			list_del(&port->next);
			mutex_unlock(&mstb->mgr->lock);
			kref_put(&port->kref, dp_mst_sim_destroy_port);
			goto put_port;
		}
		(*mstb->mgr->cbs->register_connector)(port->connector);
	}

put_port:
	kref_put(&port->kref, NULL);
	kref_put(&port->kref, dp_mst_sim_destroy_port);
}

static void dp_mst_sim_link_probe_work(struct work_struct *work)