X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fsaleae-logic%2Fsaleae-logic.c;h=0cc4245bb33447ab235a22b6ca4d0d50177df163;hb=697785d1aedc0bf385ea21074d83d61b11d8ce29;hp=173e8adaa8456cd7ef226ec91f166da0f3f95c8e;hpb=1352eeddd4d164b58f2233ae109432b73faab539;p=libsigrok.git diff --git a/hardware/saleae-logic/saleae-logic.c b/hardware/saleae-logic/saleae-logic.c index 173e8ada..0cc4245b 100644 --- a/hardware/saleae-logic/saleae-logic.c +++ b/hardware/saleae-logic/saleae-logic.c @@ -394,12 +394,19 @@ static int hw_opendev(int device_index) return SR_OK; } -static void hw_closedev(int device_index) +static int hw_closedev(int device_index) { struct sr_device_instance *sdi; - if ((sdi = sr_get_device_instance(device_instances, device_index))) - close_device(sdi); + if (!(sdi = sr_get_device_instance(device_instances, device_index))) { + sr_err("logic: %s: sdi was NULL", __func__); + return SR_ERR; /* TODO: SR_ERR_ARG? */ + } + + /* TODO */ + close_device(sdi); + + return SR_OK; } static void hw_cleanup(void)