]> xenbits.xensource.com Git - people/dstodden/blktap.git/commitdiff
PR-1053: Fix a potential crasher in tapdisk_image_open_parent.
authorDaniel Stodden <daniel.stodden@citrix.com>
Wed, 13 Jul 2011 20:53:28 +0000 (13:53 -0700)
committerDaniel Stodden <daniel.stodden@citrix.com>
Wed, 13 Jul 2011 21:00:23 +0000 (14:00 -0700)
Bail out on cases not TD_NO_PARENT, such as -ENOENT.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
drivers/tapdisk-image.c

index fe23c1e4b47d9fd87d4fce150862372d046cf871..ffec55c5d3ffb618789c598b0a1c702042ee5db0 100644 (file)
@@ -234,6 +234,8 @@ tapdisk_image_open_parent(td_image_t *image, td_image_t **_parent)
                err = 0;
                goto out;
        }
+       if (err)
+               return err;
 
        err = tapdisk_image_open(id.type, id.name, id.flags, &parent);
        if (err)