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

Commit ba3270bd authored by Deepak Kumar Singh's avatar Deepak Kumar Singh Committed by Gerrit - the friendly Code Review server
Browse files

rpmsg: glink: spi: wakeup thread waiting on intent



Releasing the glink spi channel while a client is waiting
on intent request queue can result in use after free case.

Waking up the waiting thread before channel release.

Change-Id: I697f53e6e91b67c1ef3bc310f0a29dfd28ae7826
Signed-off-by: default avatarDeepak Kumar Singh <deesin@codeaurora.org>
parent 9628d8d9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -361,6 +361,9 @@ static void glink_spi_channel_release(struct kref *ref)
	channel = container_of(ref, struct glink_spi_channel, refcount);
	CH_INFO(channel, "\n");

	channel->intent_req_result = 0;
	complete(&channel->intent_req_comp);

	mutex_lock(&channel->intent_lock);
	idr_for_each_entry(&channel->liids, tmp, iid) {
		kfree(tmp->data);