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

Commit 72909667 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "rpmsg: glink: Fix reuse intents memory leak issue"

parents 6dd892a2 389591ec
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -290,13 +290,22 @@ static void qcom_glink_channel_release(struct kref *ref)
{
	struct glink_channel *channel = container_of(ref, struct glink_channel,
						     refcount);
	struct glink_core_rx_intent *tmp;
	unsigned long flags;
	int iid;

	CH_INFO(channel, "\n");
	wake_up(&channel->intent_req_event);

	spin_lock_irqsave(&channel->intent_lock, flags);
	idr_for_each_entry(&channel->liids, tmp, iid) {
		kfree(tmp->data);
		kfree(tmp);
	}
	idr_destroy(&channel->liids);

	idr_for_each_entry(&channel->riids, tmp, iid)
		kfree(tmp);
	idr_destroy(&channel->riids);
	spin_unlock_irqrestore(&channel->intent_lock, flags);