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

Commit 647f1771 authored by Chris Lew's avatar Chris Lew
Browse files

rpmsg: glink: Put an extra reference during cleanup



In a remote processor crash scenario, there is no guarantee the remote
processor sent close requests before it went into a bad state. Remove
the reference that is normally handled by the close command in the
so channel resources can be released.

Change-Id: I02980914bfb587990c3277a945193fb89e76c504
Signed-off-by: default avatarChris Lew <clew@codeaurora.org>
parent a85b03ba
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1845,6 +1845,10 @@ void qcom_glink_native_remove(struct qcom_glink *glink)
	idr_for_each_entry(&glink->lcids, channel, cid)
		kref_put(&channel->refcount, qcom_glink_channel_release);

	/* Release any defunct local channels, waiting for close-req */
	idr_for_each_entry(&glink->lcids, channel, cid)
		kref_put(&channel->refcount, qcom_glink_channel_release);

	idr_destroy(&glink->lcids);
	idr_destroy(&glink->rcids);
	spin_unlock_irqrestore(&glink->idr_lock, flags);