dataipa: Mutex lock the ipa_lnx_stats_ioctl
Mutex locking the ipa_lnx_stats ioctl. Change-Id: Id1fe67cb5ad972dc501a0c1b5adb33b47d8dbaaa Signed-off-by: Michael Adisumarta <quic_madisuma@quicinc.com>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

szülő
be3f202f25
commit
910a63643e
@@ -52,6 +52,7 @@ static struct class *class;
|
||||
static dev_t device;
|
||||
|
||||
struct ipa_lnx_stats_spearhead_ctx ipa_lnx_agent_ctx;
|
||||
static DEFINE_MUTEX(ipa_lnx_ctx_mutex);
|
||||
|
||||
struct wlan_intf_mode_cnt {
|
||||
u8 ap_cnt;
|
||||
@@ -1765,6 +1766,7 @@ static long ipa_lnx_stats_ioctl(struct file *filp,
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
mutex_lock(&ipa_lnx_ctx_mutex);
|
||||
switch (cmd) {
|
||||
case IPA_LNX_IOC_GET_ALLOC_INFO:
|
||||
retval = ipa_stats_get_alloc_info(arg);
|
||||
@@ -1810,6 +1812,7 @@ static long ipa_lnx_stats_ioctl(struct file *filp,
|
||||
const void __user *)arg, sizeof(struct ipa_lnx_consolidated_stats));
|
||||
if (IS_ERR(consolidated_stats)) {
|
||||
IPA_STATS_ERR("copy from user failed");
|
||||
mutex_unlock(&ipa_lnx_ctx_mutex);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
@@ -1868,6 +1871,7 @@ static long ipa_lnx_stats_ioctl(struct file *filp,
|
||||
default:
|
||||
retval = -ENOTTY;
|
||||
}
|
||||
mutex_unlock(&ipa_lnx_ctx_mutex);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user