X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fzeroplus-logic-cube%2Fapi.c;h=f9578a8baceae2417f85e695215c75f312ee16aa;hb=e73ffd4238c6d1be58d3fcdcf7f100200f033856;hp=e9b5d6c7265e43e84e6dae07cc3ba1aa914bf88b;hpb=efdecf4c0553ce00ea2a6365212f5fe305496fed;p=libsigrok.git diff --git a/hardware/zeroplus-logic-cube/api.c b/hardware/zeroplus-logic-cube/api.c index e9b5d6c7..f9578a8b 100644 --- a/hardware/zeroplus-logic-cube/api.c +++ b/hardware/zeroplus-logic-cube/api.c @@ -524,10 +524,8 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi) { struct dev_context *devc; - if (!sdi) { - sr_err("%s: sdi was NULL", __func__); - return SR_ERR_ARG; - } + if (sdi->status != SR_ST_ACTIVE) + return SR_ERR_DEV_CLOSED; if (!(devc = sdi->priv)) { sr_err("%s: sdi->priv was NULL", __func__); @@ -600,6 +598,9 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi, unsigned int packet_num, n; unsigned char *buf; + if (sdi->status != SR_ST_ACTIVE) + return SR_ERR_DEV_CLOSED; + if (!(devc = sdi->priv)) { sr_err("%s: sdi->priv was NULL", __func__); return SR_ERR_ARG;