msm: adsprpc: Removal of duplicate session check with fastrpc_session_exists

Removal of duplicate session check with fastrpc_session_exists API as
it is no longer needed. Duplicate session creation is restricted using
set_session_info flag already.

Change-Id: I6b85d96f85e8d1e5af005a6939d8b9a25ca06fcf
Signed-off-by: Ansa Ahmed <quic_ansa@quicinc.com>
This commit is contained in:
Ansa Ahmed
2023-11-06 18:22:20 +05:30
parent b40e47367d
commit c5aeaa454d

View File

@@ -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 */