card_emu: Don't de-reference a NULL variable

This commit is contained in:
Harald Welte
2016-03-02 10:33:58 +01:00
parent fde250a54b
commit fcdd660fb1

View File

@@ -171,7 +171,7 @@ static void flush_rx_buffer(struct card_handle *ch)
ch->uart_rx_ctx = NULL;
/* store length of data payload fild in header */
rd = (struct cardemu_usb_msg_rx_data *) ch->uart_rx_ctx->data;
rd = (struct cardemu_usb_msg_rx_data *) rctx->data;
rd->hdr.data_len = rctx->idx;
llist_add_tail(&rctx->list, &ch->usb_tx_queue);