Commit 2dd78251 authored by Joshua Frkuska's avatar Joshua Frkuska Committed by Takashi Iwai
Browse files

pcm: direct: Protect from freeing semaphore when already in use



In the case of dshare, dsnoop, and dmix when a device is opened twice
and fails the second time, the semaphore is completely discarded. This
creates dangling semaphore data.

This patch removes the possibility for the semaphore to be destroyed during
a typical open failure by first checking if the shared memory can be destroyed
or not. If the shared memory cannot be released it means both it and the
semaphore are still in use and therefore the semaphore is just released.

Signed-off-by: default avatarJoshua Frkuska <joshua_frkuska@mentor.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 2ef7a53c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment