X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Flink-mso19%2Fprotocol.c;h=ca85ffaf60dfd920599446b9fe42871430bfedbc;hb=41812aca436805b0614f2a8f31cf2f8ce494aea0;hp=fafd83c3b93b7a15a3488496d4600da9b737e9d3;hpb=4f840ce965b1c30c5ab75afecc56193cbaf5c1b3;p=libsigrok.git diff --git a/src/hardware/link-mso19/protocol.c b/src/hardware/link-mso19/protocol.c index fafd83c3..ca85ffaf 100644 --- a/src/hardware/link-mso19/protocol.c +++ b/src/hardware/link-mso19/protocol.c @@ -42,11 +42,7 @@ SR_PRIV int mso_send_control_message(struct sr_serial_dev_inst *serial, if (serial->fd < 0) goto ret; - if (!(buf = g_try_malloc(s))) { - sr_err("Failed to malloc message buffer."); - ret = SR_ERR_MALLOC; - goto ret; - } + buf = g_malloc(s); p = buf; memcpy(p, mso_head, sizeof(mso_head)); @@ -340,7 +336,7 @@ SR_PRIV int mso_check_trigger(struct sr_serial_dev_inst *serial, uint8_t *info) sr_dbg("Requesting trigger state."); ret = mso_send_control_message(serial, ARRAY_AND_SIZE(ops)); - if (info == NULL || ret != SR_OK) + if (!info || ret != SR_OK) return ret; uint8_t buf = 0; @@ -361,7 +357,7 @@ SR_PRIV int mso_receive_data(int fd, int revents, void *cb_data) GSList *l; int i; - struct drv_context *drvc = di->priv; + struct drv_context *drvc = di->context; /* Find this device's devc struct by its fd. */ struct dev_context *devc = NULL;