When no firmware file is found, return the right error code so Sigrok doesn't
continue running with no firmware loaded.
---
 libsigrok/hardware/asix-sigma/asix-sigma.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/libsigrok/hardware/asix-sigma/asix-sigma.c 
b/libsigrok/hardware/asix-sigma/asix-sigma.c
index 5b6417d..1e4f9a7 100644
--- a/libsigrok/hardware/asix-sigma/asix-sigma.c
+++ b/libsigrok/hardware/asix-sigma/asix-sigma.c
@@ -1210,6 +1210,7 @@ static int hw_start_acquisition(int device_index, 
gpointer session_device_id)
        struct triggerinout triggerinout_conf;
        struct triggerlut lut;
        int triggerpin;
+       int ret;
 
        session_device_id = session_device_id;
 
@@ -1219,9 +1220,13 @@ static int hw_start_acquisition(int device_index, 
gpointer session_device_id)
        sigma = sdi->priv;
 
        /* If the samplerate has not been set, default to 200 KHz. */
-       if (sigma->cur_firmware == -1)
+       if (sigma->cur_firmware == -1) {
                set_samplerate(sdi, SR_KHZ(200));
 
+               if (ret == SR_ERR)
+                       return ret;
+       }
+
        /* Enter trigger programming mode. */
        sigma_set_register(WRITE_TRIGGER_SELECT1, 0x20, sigma);
 
-- 
1.7.0.4


------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to