]> sigrok.org Git - libsigrok.git/blobdiff - hardware/genericdmm/api.c
Return SR_ERR_MALLOC upon allocation errors.
[libsigrok.git] / hardware / genericdmm / api.c
index 7e93f50cb36ef5ea9adf151955dfc9783c6ee878..5b12b2e42b48ffeaef132f6766effcfb5093b886 100644 (file)
@@ -152,7 +152,7 @@ static GSList *connect_usb(const char *conn)
                /* Found one. */
                if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
                        sr_err("Device context malloc failed.");
-                       return 0;
+                       return NULL;
                }
 
                devcnt = g_slist_length(drvc->instances);
@@ -323,7 +323,7 @@ static int hw_init(void)
 
        if (!(drvc = g_try_malloc0(sizeof(struct drv_context)))) {
                sr_err("Driver context malloc failed.");
-               return SR_ERR;
+               return SR_ERR_MALLOC;
        }
 
        if (libusb_init(&genericdmm_usb_context) != 0) {