diff --git a/sound/soc/msm/qdsp6v2/q6asm.c b/sound/soc/msm/qdsp6v2/q6asm.c index 95b769d2f358..246fd17472f4 100644 --- a/sound/soc/msm/qdsp6v2/q6asm.c +++ b/sound/soc/msm/qdsp6v2/q6asm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. * Author: Brian Swetland * * This software is licensed under the terms of the GNU General Public @@ -423,6 +423,7 @@ static void q6asm_session_free(struct audio_client *ac) { struct list_head *ptr, *next; struct asm_no_wait_node *node; + unsigned long flags; pr_debug("%s: sessionid[%d]\n", __func__, ac->session); rtac_remove_popp_from_adm_devices(ac->session); @@ -431,12 +432,13 @@ static void q6asm_session_free(struct audio_client *ac) ac->perf_mode = LEGACY_PCM_MODE; ac->fptr_cache_ops = NULL; + spin_lock_irqsave(&ac->no_wait_que_spinlock, flags); list_for_each_safe(ptr, next, &ac->no_wait_que) { node = list_entry(ptr, struct asm_no_wait_node, list); list_del(&node->list); kfree(node); } - list_del(&ac->no_wait_que); + spin_unlock_irqrestore(&ac->no_wait_que_spinlock, flags); return; }