ANDROID: gunyah: Convert mutex_lock_interruptible to mutex_lock Crosvm thread can get interrupted while making a call to the Resource Manager. If we wait on mutext_lock_interruptible, the RM call might be incomplete and as part of the cleanup if there are further RM calls that need to be made, they will also return without making the RM call because there is a signal on the thread. Use mutex_lock while making the RM calls to ensure the RM call completes and only if there is a geniune error, we can clean up. Bug: 302322730 Change-Id: I961aa917588a72bb8733e6f80d80f3ceed179076 Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
diff --git a/drivers/virt/gunyah/rsc_mgr.c b/drivers/virt/gunyah/rsc_mgr.c index dd6fe39..170a2d3 100644 --- a/drivers/virt/gunyah/rsc_mgr.c +++ b/drivers/virt/gunyah/rsc_mgr.c
@@ -567,10 +567,7 @@ static int gh_rm_send_request(struct gh_rm *rm, u32 message_id, hdr_template.seq = cpu_to_le16(connection->reply.seq); hdr_template.msg_id = cpu_to_le32(message_id); - ret = mutex_lock_interruptible(&rm->send_lock); - if (ret) - return ret; - + mutex_lock(&rm->send_lock); do { msg = kmem_cache_zalloc(rm->cache, GFP_KERNEL); if (!msg) {