X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fzeroplus-logic-cube%2Fzeroplus.c;h=f5b2d9e4443268956df325ccec771397dd993957;hb=697785d1aedc0bf385ea21074d83d61b11d8ce29;hp=9b867dca43e134da40f30a3d989caad7ddaef0d9;hpb=1352eeddd4d164b58f2233ae109432b73faab539;p=libsigrok.git diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index 9b867dca..f5b2d9e4 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -370,12 +370,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("lap-c: %s: sdi was NULL", __func__); + return SR_ERR; /* TODO: SR_ERR_ARG? */ + } + + /* TODO */ + close_device(sdi); + + return SR_OK; } static void hw_cleanup(void)