Merge "msm: adsprpc: Removal of duplicate session check with fastrpc_session_exists"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
1853583b3e
@@ -4348,38 +4348,6 @@ bail:
|
||||
kfree(proc_name);
|
||||
}
|
||||
|
||||
/*
|
||||
* Function to restrict duplicate session creation with same tgid, cid.
|
||||
* check introduced after extended session creation
|
||||
* to avoid breaking in case of extended sessions.
|
||||
*/
|
||||
|
||||
static bool fastrpc_session_exists(struct fastrpc_apps *me, uint32_t cid, int tgid)
|
||||
{
|
||||
struct fastrpc_file *fl;
|
||||
struct hlist_node *n;
|
||||
bool session_found = false;
|
||||
unsigned long irq_flags = 0;
|
||||
int total_session_count = 0;
|
||||
|
||||
spin_lock_irqsave(&me->hlock, irq_flags);
|
||||
hlist_for_each_entry_safe(fl, n, &me->drivers, hn) {
|
||||
if (fl->tgid == tgid && fl->cid == cid) {
|
||||
++total_session_count;
|
||||
if (total_session_count > 1) {
|
||||
session_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(&me->hlock, irq_flags);
|
||||
if (session_found)
|
||||
ADSPRPC_ERR(
|
||||
"trying to open a session that already exists for tgid %d, channel ID %u\n",
|
||||
tgid, cid);
|
||||
|
||||
return session_found;
|
||||
}
|
||||
|
||||
int fastrpc_init_process(struct fastrpc_file *fl,
|
||||
struct fastrpc_ioctl_init_attrs *uproc)
|
||||
@@ -4405,11 +4373,6 @@ int fastrpc_init_process(struct fastrpc_file *fl,
|
||||
err = -ECHRNG;
|
||||
goto bail;
|
||||
}
|
||||
VERIFY(err, !fastrpc_session_exists(me, fl->cid, fl->tgid));
|
||||
if (err) {
|
||||
err = -EEXIST;
|
||||
goto bail;
|
||||
}
|
||||
chan = &me->channel[cid];
|
||||
if (chan->unsigned_support && fl->dev_minor == MINOR_NUM_DEV) {
|
||||
/* Make sure third party applications */
|
||||
|
||||
Reference in New Issue
Block a user