X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fpipistrello-ols%2Fapi.c;h=acbfcda0289606b66be4086ae0ef8c62fc7a6215;hb=b6085eb17901306b686a9269e5d2660d88561dc3;hp=9287509f8e3c1088f4d0376524e0e1df2dc5f00b;hpb=5827f61b641cfd326a9cf2ea534eb4f9481a8187;p=libsigrok.git diff --git a/src/hardware/pipistrello-ols/api.c b/src/hardware/pipistrello-ols/api.c index 9287509f..acbfcda0 100644 --- a/src/hardware/pipistrello-ols/api.c +++ b/src/hardware/pipistrello-ols/api.c @@ -100,10 +100,7 @@ static GSList *scan(GSList *options) devices = NULL; /* Allocate memory for our private device context. */ - if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { - sr_err("Device context malloc failed."); - goto err_free_nothing; - } + devc = g_malloc0(sizeof(struct dev_context)); /* Device-specific settings */ devc->max_samplebytes = devc->max_samplerate = devc->protocol_version = 0; @@ -185,7 +182,6 @@ static GSList *scan(GSList *options) /* Parse the metadata. */ sdi = p_ols_get_metadata((uint8_t *)buf, bytes_read, devc); - sdi->index = 0; /* Configure samplerate and divider. */ if (p_ols_set_samplerate(sdi, DEFAULT_SAMPLERATE) != SR_OK) @@ -205,7 +201,6 @@ err_free_ftdi_buf: g_free(devc->ftdi_buf); err_free_devc: g_free(devc); -err_free_nothing: return NULL; }