diff options
author | qctecmdr <qctecmdr@localhost> | 2022-11-30 17:45:22 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2022-11-30 17:45:22 -0800 |
commit | d7ece74a363668306596f2d1206b6c69ad358930 (patch) | |
tree | 5cf8c39e776f9a61688a3c03acf706b07db1e72e | |
parent | 3c3270b3313710c492874a7725436b37e392cecd (diff) | |
parent | aa9208b3940eefaf6fe7c38c62223059a4b2b617 (diff) | |
download | dataipa-d7ece74a363668306596f2d1206b6c69ad358930.tar.gz |
Merge "dataipa: Mutex lock the ipa_lnx_stats_ioctl"
-rw-r--r-- | drivers/platform/msm/ipa/ipa_v3/ipa_stats.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_stats.c b/drivers/platform/msm/ipa/ipa_v3/ipa_stats.c index 43f48a9..2cd1e7c 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_stats.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_stats.c @@ -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; } |