Fix to prevent abort during mq_close
authorTaeJun Kwon <tj80.kwon@samsung.com>
Fri, 15 Sep 2017 15:57:36 +0000 (00:57 +0900)
committerShivam Garg <garg.shivam@samsung.com>
Mon, 18 Sep 2017 14:03:34 +0000 (23:03 +0900)
framework/src/tinyalsa/tinyalsa.c
os/audio/audio.c

index 6f09ce0..5b07140 100644 (file)
@@ -734,7 +734,6 @@ int pcm_close(struct pcm *pcm)
                }
        }
 #endif
-       mq_close(pcm->mq);                      /* Close the message queue */
        mq_unlink(pcm->mqname);
 
        if (pcm->fd >= 0) {
index 6bf99eb..0bddceb 100644 (file)
@@ -579,6 +579,7 @@ static int audio_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
 
        case AUDIOIOC_UNREGISTERMQ: {
                audvdbg("AUDIOIOC_UNREGISTERMQ\n");
+               mq_close(upper->usermq);                        /* Close the message queue */
 
                upper->usermq = NULL;
                ret = OK;