X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhardware%2Fhameg-hmo%2Fapi.c;h=4b50b7aa6edb7a37dffaea3bdcac019de899def5;hb=709468baf7626b162b5559c101516289d9bbb258;hp=b89de8d8a096a393b07cf15f8c4bbd8f3b23435c;hpb=c2fdcc25a47c4c8f25e3ea96ea36a674a151e839;p=libsigrok.git diff --git a/src/hardware/hameg-hmo/api.c b/src/hardware/hameg-hmo/api.c index b89de8d8..4b50b7aa 100644 --- a/src/hardware/hameg-hmo/api.c +++ b/src/hardware/hameg-hmo/api.c @@ -189,9 +189,11 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s const struct scope_config *model; struct scope_state *state; - if (!sdi || !(devc = sdi->priv)) + if (!sdi) return SR_ERR_ARG; + devc = sdi->priv; + if ((cg_type = check_channel_group(devc, cg)) == CG_INVALID) return SR_ERR; @@ -318,9 +320,11 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd double tmp_d; gboolean update_sample_rate; - if (!sdi || !(devc = sdi->priv)) + if (!sdi) return SR_ERR_ARG; + devc = sdi->priv; + if ((cg_type = check_channel_group(devc, cg)) == CG_INVALID) return SR_ERR;