Merge "msm: adsprpc : Mark tgid_frpc unuse after device unregister"

This commit is contained in:
qctecmdr
2023-10-31 04:08:15 -07:00
committed by Gerrit - the friendly Code Review server

View File

@@ -5958,13 +5958,15 @@ skip_dump_wait:
fl->is_ramdump_pend = false; fl->is_ramdump_pend = false;
fl->is_dma_invoke_pend = false; fl->is_dma_invoke_pend = false;
fl->dsp_process_state = PROCESS_CREATE_DEFAULT; fl->dsp_process_state = PROCESS_CREATE_DEFAULT;
/* Reset the tgid usage to false */
if (fl->tgid_frpc != -1)
frpc_tgid_usage_array[fl->tgid_frpc] = false;
is_locked = false; is_locked = false;
spin_unlock_irqrestore(&fl->apps->hlock, irq_flags); spin_unlock_irqrestore(&fl->apps->hlock, irq_flags);
if (!fl->sctx) { if (!fl->sctx) {
spin_lock_irqsave(&me->hlock, irq_flags);
/* Reset the tgid usage to false */
if (fl->tgid_frpc != -1)
frpc_tgid_usage_array[fl->tgid_frpc] = false;
spin_unlock_irqrestore(&me->hlock, irq_flags);
kfree(fl); kfree(fl);
return 0; return 0;
} }
@@ -6007,6 +6009,12 @@ skip_dump_wait:
if (fl->device && is_driver_closed) if (fl->device && is_driver_closed)
device_unregister(&fl->device->dev); device_unregister(&fl->device->dev);
spin_lock_irqsave(&me->hlock, irq_flags);
/* Reset the tgid usage to false */
if (fl->tgid_frpc != -1)
frpc_tgid_usage_array[fl->tgid_frpc] = false;
spin_unlock_irqrestore(&me->hlock, irq_flags);
VERIFY(err, VALID_FASTRPC_CID(cid)); VERIFY(err, VALID_FASTRPC_CID(cid));
if (!err && fl->sctx) if (!err && fl->sctx)
fastrpc_session_free(&fl->apps->channel[cid], fl->sctx); fastrpc_session_free(&fl->apps->channel[cid], fl->sctx);