X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fatten-pps3xxx%2Fapi.c;h=b72eeb4a59107aff7b415438e23efeb0c904dd71;hb=6b80b80dcf2c6f6cdc4c8a782085846c861bd10d;hp=b42036bfbd147182057226560385420419ba59cc;hpb=1f889afd619833ce93ef6afa066ba0797d9ec46c;p=libsigrok.git diff --git a/src/hardware/atten-pps3xxx/api.c b/src/hardware/atten-pps3xxx/api.c index b42036bf..b72eeb4a 100644 --- a/src/hardware/atten-pps3xxx/api.c +++ b/src/hardware/atten-pps3xxx/api.c @@ -122,11 +122,11 @@ static GSList *scan(GSList *options, int modelid) if (!serialcomm) serialcomm = SERIALCOMM; - if (!(serial = sr_serial_dev_inst_new(conn, serialcomm))) - return NULL; + serial = sr_serial_dev_inst_new(conn, serialcomm); if (serial_open(serial, SERIAL_RDWR) != SR_OK) return NULL; + serial_flush(serial); /* This is how the vendor software scans for hardware. */ @@ -164,7 +164,7 @@ static GSList *scan(GSList *options, int modelid) return NULL; } - sdi = sr_dev_inst_new(); + sdi = g_malloc0(sizeof(struct sr_dev_inst)); sdi->status = SR_ST_INACTIVE; sdi->vendor = g_strdup("Atten"); sdi->model = g_strdup(model->name);