]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/motech-lps-30x/api.c
Use g_malloc0() consistently, simplify error handling.
[libsigrok.git] / src / hardware / motech-lps-30x / api.c
index 9c01ea455077ac8041a75909bba6c59d1e0b846e..f118ebe33bb7593eae4e6d313800527008232122 100644 (file)
@@ -402,8 +402,7 @@ static GSList *do_scan(lps_modelid modelid, struct sr_dev_driver *drv, GSList *o
                serialcomm = SERIALCOMM;
 
        /* Init serial port. */
-       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)
                goto exit_err;