When the ->post_select method of a filter returns negative, it *must*
remove its buffer tree node as well. The prebuffer missed to do that,
which results in a stale reference to the buffer tree which keeps
the audiod slot busy. When no more slots are free, audiod hangs or
exits with a "no more free slots" message. This patch avoids this.
ret = task_get_notification(fn->task);
if (ret < 0)
- return ret;
+ goto fail;
ret = btr_node_status(btrn, size, BTR_NT_INTERNAL);
if (ret < 0)
- return ret;
+ goto fail;
if (ppd->barrier.tv_sec == 0)
return 0;
if (tv_diff(now, &ppd->barrier, NULL) < 0)
return 0;
btr_splice_out_node(&fn->btrn);
return -E_PREBUFFER_SUCCESS;
+fail:
+ btr_remove_node(&fn->btrn);
+ return ret;
}
static void prebuffer_open(struct filter_node *fn)