From 25c72537e806d89ac434476c707d2ad2ef109799 Mon Sep 17 00:00:00 2001 From: Zhongbo Shi Date: Fri, 26 Nov 2021 10:17:04 +0800 Subject: [PATCH] Video: Driver: fix crash issue when dumping packet Using session id instead of session debug string when dumping packet for a given session, in case of the instance objest released in the other thread. Change-Id: I1b91c051d510b8beea9d37de87f63f346efda050 Signed-off-by: Zhongbo Shi --- driver/vidc/src/venus_hfi.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/driver/vidc/src/venus_hfi.c b/driver/vidc/src/venus_hfi.c index 55dc6d3b29..7e4d85291a 100644 --- a/driver/vidc/src/venus_hfi.c +++ b/driver/vidc/src/venus_hfi.c @@ -139,36 +139,21 @@ static void __dump_packet(u8 *packet, const char *function, void *qinfo) { u32 c = 0, session_id, packet_size = *(u32 *)packet; const int row_size = 32; - struct msm_vidc_inst *inst = NULL; - bool matches = false; /* * row must contain enough for 0xdeadbaad * 8 to be converted into * "de ad ba ab " * 8 + '\0' */ char row[3 * 32]; - session_id = *((u32 *)packet + 1); - list_for_each_entry(inst, &g_core->instances, list) { - if (inst->session_id == session_id) { - matches = true; - break; - } - } - if (matches) - i_vpr_t(inst, "%s: %pK\n", function, qinfo); - else - d_vpr_t("%s: %pK\n", function, qinfo); + d_vpr_t("%08x: %s: %pK\n", session_id, function, qinfo); for (c = 0; c * row_size < packet_size; ++c) { int bytes_to_read = ((c + 1) * row_size > packet_size) ? packet_size % row_size : row_size; hex_dump_to_buffer(packet + c * row_size, bytes_to_read, row_size, 4, row, sizeof(row), false); - if (matches) - i_vpr_t(inst, "%s\n", row); - else - d_vpr_t("%s\n", row); + d_vpr_t("%08x: %s\n", session_id, row); } }