]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/atten-pps3xxx/api.c
Use g_malloc0() consistently, simplify error handling.
[libsigrok.git] / src / hardware / atten-pps3xxx / api.c
index 580bc51d4632edb4e947a9033530d4e3729a290c..b72eeb4a59107aff7b415438e23efeb0c904dd71 100644 (file)
@@ -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. */