audiod: Make writer_cleanup() accept NULL pointer argument.
authorAndre Noll <maan@systemlinux.org>
Mon, 11 Jan 2010 23:55:59 +0000 (00:55 +0100)
committerAndre Noll <maan@systemlinux.org>
Mon, 11 Jan 2010 23:55:59 +0000 (00:55 +0100)
audiod.c

index 456813b..322ce3b 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -340,8 +340,12 @@ static void close_receiver(int slot_num)
 
 static void writer_cleanup(struct writer_node *wn)
 {
-       struct writer *w = writers + wn->writer_num;
+       struct writer *w;
 
+       if (!wn)
+               return;
+       w = writers + wn->writer_num;
+       PARA_INFO_LOG("closing %s\n", writer_names[wn->writer_num]);
        w->close(wn);
        btr_free_node(wn->btrn);
 }