X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhameg-hmo%2Fapi.c;h=77feac8637d54c00d039fd761cf5a39794bba0d3;hb=bf622e6d00e7985e36a0ddb643e2bf05d66679a6;hp=b516b2d8f08fd999298cf078913b4f7c4397ef84;hpb=6ec3ef9b9255098240baec5e61a6a89d22960690;p=libsigrok.git diff --git a/src/hardware/hameg-hmo/api.c b/src/hardware/hameg-hmo/api.c index b516b2d8..77feac86 100644 --- a/src/hardware/hameg-hmo/api.c +++ b/src/hardware/hameg-hmo/api.c @@ -79,7 +79,7 @@ static struct sr_dev_inst *hmo_probe_serial_device(struct sr_scpi_dev_inst *scpi if (check_manufacturer(hw_info->manufacturer) != SR_OK) goto fail; - sdi = sr_dev_inst_new(); + sdi = g_malloc0(sizeof(struct sr_dev_inst)); sdi->status = SR_ST_ACTIVE; sdi->vendor = g_strdup(hw_info->manufacturer); sdi->model = g_strdup(hw_info->model); @@ -92,8 +92,7 @@ static struct sr_dev_inst *hmo_probe_serial_device(struct sr_scpi_dev_inst *scpi sr_scpi_hw_info_free(hw_info); hw_info = NULL; - if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) - goto fail; + devc = g_malloc0(sizeof(struct dev_context)); sdi->priv = devc; @@ -222,7 +221,7 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s state = devc->model_state; switch (key) { - case SR_CONF_NUM_TIMEBASE: + case SR_CONF_NUM_HDIV: *data = g_variant_new_int32(model->num_xdivs); ret = SR_OK; break;