]> sigrok.org Git - libsigrok.git/blobdiff - hardware/zeroplus-logic-cube/zeroplus.c
Return SR_ERR_MALLOC upon allocation errors.
[libsigrok.git] / hardware / zeroplus-logic-cube / zeroplus.c
index c22f9458418aee2524ab19cf7d1431312a7e469f..f1b6431b9f8c93a8e7f750305928d99700d73e7a 100644 (file)
@@ -257,7 +257,7 @@ static int hw_init(void)
 
        if (!(drvc = g_try_malloc0(sizeof(struct drv_context)))) {
                sr_err("zeroplus: driver context malloc failed.");
-               return SR_ERR;
+               return SR_ERR_MALLOC;
        }
        zdi->priv = drvc;
 
@@ -321,7 +321,7 @@ static GSList *hw_scan(GSList *options)
                /* Allocate memory for our private driver context. */
                if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
                        sr_err("zp: %s: devc malloc failed", __func__);
-                       return 0;
+                       return NULL;
                }
                sdi->priv = devc;
                devc->num_channels = prof->channels;