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

Commit 273eea68 authored by Chris Lew's avatar Chris Lew
Browse files

trace: ipc_logging: Fix potential dead in ipc_log_write



Fix potential deadlock by unlocking spinlock when returning
from an error case during ipc_log_write.

CRs-Fixed: 2059308
Change-Id: If253470d720af1b42f9ebcfb98d69d4c65ab73bc
Signed-off-by: default avatarChris Lew <clew@codeaurora.org>
parent ffd90498
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -314,8 +314,11 @@ void ipc_log_write(void *ctxt, struct encode_context *ectxt)
		ilctxt->write_page->hdr.end_time = t_now;

		ilctxt->write_page = get_next_page(ilctxt, ilctxt->write_page);
		if (WARN_ON(ilctxt->write_page == NULL))
		if (WARN_ON(ilctxt->write_page == NULL)) {
			spin_unlock(&ilctxt->context_lock_lhb1);
			read_unlock_irqrestore(&context_list_lock_lha1, flags);
			return;
		}
		ilctxt->write_page->hdr.write_offset = 0;
		ilctxt->write_page->hdr.start_time = t_now;
		memcpy((ilctxt->write_page->data +