]> sigrok.org Git - libsigrok.git/commitdiff
lecroy-xstream: Properly handle a stopping acquisition
authorSoeren Apel <redacted>
Wed, 3 Jan 2018 22:44:27 +0000 (23:44 +0100)
committerUwe Hermann <redacted>
Thu, 11 Jan 2018 01:21:50 +0000 (02:21 +0100)
src/hardware/lecroy-xstream/api.c

index 533275a28882deeb7f2fd43e24def96a6a37ac6a..070ac7c13f7a4428afcb4c5199f60891da57302e 100644 (file)
@@ -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)