summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/nmf-cm/cmld.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/nmf-cm/cmld.c b/drivers/staging/nmf-cm/cmld.c
index d96ceaa3fe5..925ce038862 100644
--- a/drivers/staging/nmf-cm/cmld.c
+++ b/drivers/staging/nmf-cm/cmld.c
@@ -165,16 +165,15 @@ static inline void freeChannels(struct cm_process_priv* processPriv)
{
struct list_head* head, *next;
int warn = 0;
-
+
+ mutex_lock(&channel_lock);
list_for_each_safe(head, next, &channel_list) {
struct cm_channel_priv *channelPriv;
channelPriv = list_entry(head, struct cm_channel_priv, entry);
/* Only channels belonging to this process are concerned */
if (channelPriv->proc == processPriv) {
tasklet_disable(&cmld_service_tasklet);
- mutex_lock(&channel_lock);
list_del(&channelPriv->entry);
- mutex_unlock(&channel_lock);
tasklet_enable(&cmld_service_tasklet);
/* Free all remaining messages if any
@@ -190,6 +189,8 @@ static inline void freeChannels(struct cm_process_priv* processPriv)
}
warn = 1;
}
+ mutex_unlock(&channel_lock);
+
if (warn)
pr_err("[CM - PID=%d]: Some remaining channel entries "
"freed\n", current->tgid);