diff options
author | Holger Freyther <zecke@selfish.org> | 2009-02-09 21:05:56 +0000 |
---|---|---|
committer | Holger Freyther <zecke@selfish.org> | 2009-02-09 21:05:56 +0000 |
commit | 3630eab5722fbd63b505720a6dc3a9244fdfb6de (patch) | |
tree | c50185b1dcd15b8345d6f65368e245549188958e /src/subchan_demux.c | |
parent | ce6efc295f4db1363d4a0e07f5833973de452356 (diff) |
fix segfault when trying to dequeue list head as list element
Diffstat (limited to 'src/subchan_demux.c')
-rw-r--r-- | src/subchan_demux.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/subchan_demux.c b/src/subchan_demux.c index 78ba2dae2..d8bf29f16 100644 --- a/src/subchan_demux.c +++ b/src/subchan_demux.c @@ -202,13 +202,13 @@ static int get_subch_bits(struct subch_mux *mx, int subch, /* make sure we have a valid entry at top of tx queue. * if not, add an idle frame */ - if (llist_empty(&sch->tx_queue)) + if (llist_empty(&sch->tx_queue)) alloc_add_idle_frame(mx, subch); if (llist_empty(&sch->tx_queue)) return -EIO; - txe = llist_entry(&sch->tx_queue, struct subch_txq_entry, list); + txe = llist_entry(sch->tx_queue.next, struct subch_txq_entry, list); num_bits_left = txe->bit_len - txe->next_bit; if (num_bits_left < num_requested) @@ -291,7 +291,7 @@ int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const u_int8_t *data, tqe->bit_len = len; memcpy(tqe->bits, data, len); - llist_add(&tqe->list, &sch->tx_queue); + llist_add_tail(&tqe->list, &sch->tx_queue); return 0; } |