]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/openbench-logic-sniffer/api.c
Use g_malloc0() consistently, simplify error handling.
[libsigrok.git] / src / hardware / openbench-logic-sniffer / api.c
index cb55bf19a6f891b0cc3abe24c4bbf8c4f7215cec..acbb971823846f326d72c7880765562da55ade70 100644 (file)
@@ -128,8 +128,7 @@ static GSList *scan(GSList *options)
        if (serialcomm == NULL)
                serialcomm = SERIALCOMM;
 
-       if (!(serial = sr_serial_dev_inst_new(conn, serialcomm)))
-               return NULL;
+       serial = sr_serial_dev_inst_new(conn, serialcomm);
 
        /* The discovery procedure is like this: first send the Reset
         * command (0x00) 5 times, since the device could be anywhere