]> git.tuebingen.mpg.de Git - paraslash.git/commit
Fix alsa_init() error path.
authorAndre Noll <maan@systemlinux.org>
Sun, 20 Feb 2011 16:01:15 +0000 (17:01 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 20 Feb 2011 19:26:29 +0000 (20:26 +0100)
commit0267a3f3f13e16bc92b890e1d5bd49c5bd5c58e3
tree1c051ad835adea8f617d35122af527e33648e5f4
parented8e836fcebaf380f19296f1c12c68b63dadce1e
Fix alsa_init() error path.

If alsa_init() fails, alsa_write_post_select() removes the buffer tree
node and sets t->error to a negative value. para_audiod (or para_write)
then calls alsa->close() to deallocate any resources. At this point
wn->private_data is non-NULL while  pad->handle _is_ NULL. The
subsequent call to snd_pcm_nonblock() therefore triggers the assertion

para_audiod: pcm.c:724: snd_pcm_nonblock: Assertion `pcm' failed.

which aborts para_audiod. Fix this bug by freeing the ->private_data
pointer already in alsa_write_post_select() if alsa_init() fails. This
way, ->private_data and pad->handle are either both NULL or both
non-NULL, which meets the expectations of alsa_close().
alsa_write.c