diff options
author | Pierre Peiffer <pierre.peiffer@stericsson.com> | 2011-10-20 13:09:01 +0200 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:07:03 +0200 |
commit | 872dcea1624d339d205e1e8a31e8f29be8d84ccb (patch) | |
tree | 49329a115ebba97a451cc7c8e73a1f2b46811aad | |
parent | febb8c01c1b0702a3eab3ab41a0369844153e49c (diff) |
U8500 CM: fix re-entrancy issue
Fix a re-entrancy issue when killing two processes that
use the CM driver simultaneously.
ST-Ericsson ID: 364585
ST-Ericsson Linux next: NA
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: I48cb434b87a85b635fe4506a92d7b1c7086071fb
Signed-off-by: Pierre Peiffer <pierre.peiffer@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/35216
Reviewed-by: QATOOLS
Reviewed-by: QABUILD
-rw-r--r-- | drivers/staging/nmf-cm/cmld.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/nmf-cm/cmld.c b/drivers/staging/nmf-cm/cmld.c index 7b1061d9d52..ef9753de7a4 100644 --- a/drivers/staging/nmf-cm/cmld.c +++ b/drivers/staging/nmf-cm/cmld.c @@ -166,16 +166,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 @@ -191,6 +190,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); |