mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
securemsm-kernel: Decrement the server object ref count in mutex context
Decrement the smcinvoke server object refcount in mutex context so that we never get an object which is being freed. Change-Id: I1bab3d630436923c7eb60f2d46dcc3f2bd037097 Signed-off-by: Nishant Pandey <quic_nishpand@quicinc.com>
This commit is contained in:
parent
ed97e9cf1d
commit
01f564dfc6
1 changed files with 5 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) "smcinvoke: %s: " fmt, __func__
|
||||
|
|
@ -1866,8 +1866,11 @@ static long process_accept_req(struct file *filp, unsigned int cmd,
|
|||
}
|
||||
} while (!cb_txn);
|
||||
out:
|
||||
if (server_info)
|
||||
if (server_info) {
|
||||
mutex_lock(&g_smcinvoke_lock);
|
||||
kref_put(&server_info->ref_cnt, destroy_cb_server);
|
||||
mutex_unlock(&g_smcinvoke_lock);
|
||||
}
|
||||
|
||||
if (ret && ret != -ERESTARTSYS)
|
||||
pr_err("accept thread returning with ret: %d\n", ret);
|
||||
|
|
|
|||
Loading…
Reference in a new issue