Fixes: 5600b901 ("async: snd_async_del_handler - move clear signal using sigaction as last")

A wrong list head is used to check if the given list with async handlers
is empty. Correct this.

Link: https://github.com/alsa-project/alsa-lib/issues/394
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2024-09-06 09:58:47 +02:00
parent 645668dca2
commit 3b9f3b9431

View file

@ -153,9 +153,22 @@ int snd_async_del_handler(snd_async_handler_t *handler)
int was_empty;
assert(handler);
if (handler->type != SND_ASYNC_HANDLER_GENERIC) {
if (!list_empty(&handler->hlist))
struct list_head *alist;
switch (handler->type) {
#ifdef BUILD_PCM
case SND_ASYNC_HANDLER_PCM:
alist = &handler->u.pcm->async_handlers;
break;
#endif
case SND_ASYNC_HANDLER_CTL:
alist = &handler->u.ctl->async_handlers;
break;
default:
assert(0);
}
if (!list_empty(alist))
list_del(&handler->hlist);
if (!list_empty(&handler->hlist))
if (!list_empty(alist))
goto _glist;
switch (handler->type) {
#ifdef BUILD_PCM