Merge "dsp-kernel: Handle memory leak in fastrpc file free"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
cfd8b01ad3
@@ -6029,16 +6029,8 @@ skip_dmainvoke_wait:
|
|||||||
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);
|
goto bail;
|
||||||
/* 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);
|
|
||||||
fl = NULL;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Dummy wake up to exit Async worker thread
|
//Dummy wake up to exit Async worker thread
|
||||||
spin_lock_irqsave(&fl->aqlock, flags);
|
spin_lock_irqsave(&fl->aqlock, flags);
|
||||||
@@ -6092,23 +6084,22 @@ skip_dmainvoke_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);
|
||||||
if (!err && fl->secsctx)
|
if (!err && fl->secsctx)
|
||||||
fastrpc_session_free(&fl->apps->channel[cid], fl->secsctx);
|
fastrpc_session_free(&fl->apps->channel[cid], fl->secsctx);
|
||||||
|
|
||||||
for (i = 0; i < (DSPSIGNAL_NUM_SIGNALS / DSPSIGNAL_GROUP_SIZE); i++)
|
for (i = 0; i < (DSPSIGNAL_NUM_SIGNALS / DSPSIGNAL_GROUP_SIZE); i++)
|
||||||
kfree(fl->signal_groups[i]);
|
kfree(fl->signal_groups[i]);
|
||||||
mutex_destroy(&fl->signal_create_mutex);
|
|
||||||
|
|
||||||
fastrpc_remote_buf_list_free(fl);
|
fastrpc_remote_buf_list_free(fl);
|
||||||
|
|
||||||
|
bail:
|
||||||
|
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);
|
||||||
|
mutex_destroy(&fl->signal_create_mutex);
|
||||||
mutex_destroy(&fl->map_mutex);
|
mutex_destroy(&fl->map_mutex);
|
||||||
mutex_destroy(&fl->internal_map_mutex);
|
mutex_destroy(&fl->internal_map_mutex);
|
||||||
kfree(fl->dev_pm_qos_req);
|
kfree(fl->dev_pm_qos_req);
|
||||||
|
|||||||
Reference in New Issue
Block a user