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 |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libsigrok/hardware/asix-sigma/asix-sigma.c 
b/libsigrok/hardware/asix-sigma/asix-sigma.c
index 5b6417d..e0c6a79 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,8 +1220,12 @@ 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)
-               set_samplerate(sdi, SR_KHZ(200));
+       if (sigma->cur_firmware == -1) {
+               ret = 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.1


------------------------------------------------------------------------------
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