Skip to content

Commit

Permalink
Fixes: 5600b90 ("async: snd_async_del_handler - move clear signal usi…
Browse files Browse the repository at this point in the history
…ng sigaction as last")

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

Link: #394
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
  • Loading branch information
perexg committed Sep 6, 2024
1 parent 645668d commit 3b9f3b9
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/async.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3b9f3b9

Please sign in to comment.