From: Soeren Apel Date: Wed, 3 Jan 2018 22:44:27 +0000 (+0100) Subject: lecroy-xstream: Properly handle a stopping acquisition X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=724b4945d59c42f42a65ccfbe0a6ecf8744ee58f;p=libsigrok.git lecroy-xstream: Properly handle a stopping acquisition --- diff --git a/src/hardware/lecroy-xstream/api.c b/src/hardware/lecroy-xstream/api.c index 533275a2..070ac7c1 100644 --- a/src/hardware/lecroy-xstream/api.c +++ b/src/hardware/lecroy-xstream/api.c @@ -360,6 +360,14 @@ SR_PRIV int lecroy_xstream_request_data(const struct sr_dev_inst *sdi) struct dev_context *devc; devc = sdi->priv; + + /* + * We may be left with an invalid current_channel if acquisition was + * already stopped but we are processing the last pending events. + */ + if (!devc->current_channel) + return SR_ERR_NA; + ch = devc->current_channel->data; if (ch->type != SR_CHANNEL_ANALOG)