]> Pileus Git - ~andy/linux/blobdiff - drivers/staging/usbip/userspace/libsrc/names.c
Merge tag 'sunxi-fixes-for-3.14' of https://github.com/mripard/linux into fixes
[~andy/linux] / drivers / staging / usbip / userspace / libsrc / names.c
index 3c8d28b771e0bba93de1337d8671dc784f6d355e..81ff8522405c29eb69675982cd3dc0407728964a 100644 (file)
@@ -169,14 +169,14 @@ static void *my_malloc(size_t size)
        struct pool *p;
 
        p = calloc(1, sizeof(struct pool));
-       if (!p) {
-               free(p);
+       if (!p)
                return NULL;
-       }
 
        p->mem = calloc(1, size);
-       if (!p->mem)
+       if (!p->mem) {
+               free(p);
                return NULL;
+       }
 
        p->next = pool_head;
        pool_head = p;