[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] blktapctrl: Fix a potential device minor number leak.
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1204542490 0 # Node ID 990eb630033a53d5c319376c022283b192890882 # Parent 69bb0c4af952485fdf5fed06a62693e9052259d0 blktapctrl: Fix a potential device minor number leak. Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx> --- tools/blktap/drivers/blktapctrl.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff -r 69bb0c4af952 -r 990eb630033a tools/blktap/drivers/blktapctrl.c --- a/tools/blktap/drivers/blktapctrl.c Mon Mar 03 11:06:31 2008 +0000 +++ b/tools/blktap/drivers/blktapctrl.c Mon Mar 03 11:08:10 2008 +0000 @@ -518,7 +518,7 @@ int blktapctrl_new_blkif(blkif_t *blkif) if (test_path(blk->params, &ptr, &type, &exist) != 0) { DPRINTF("Error in blktap device string(%s).\n", blk->params); - return -1; + goto fail; } blkif->drivertype = type; blkif->cookie = next_cookie++; @@ -527,11 +527,11 @@ int blktapctrl_new_blkif(blkif_t *blkif) DPRINTF("Process does not exist:\n"); if (asprintf(&rdctldev, "%s/tapctrlread%d", BLKTAP_CTRL_DIR, minor) == -1) - return -1; + goto fail; if (asprintf(&wrctldev, "%s/tapctrlwrite%d", BLKTAP_CTRL_DIR, minor) == -1) { free(rdctldev); - return -1; + goto fail; } blkif->fds[READ] = open_ctrl_socket(rdctldev); blkif->fds[WRITE] = open_ctrl_socket(wrctldev); @@ -543,7 +543,7 @@ int blktapctrl_new_blkif(blkif_t *blkif) DPRINTF("Launching process, CMDLINE [tapdisk %s %s]\n",wrctldev, rdctldev); if (launch_tapdisk(wrctldev, rdctldev) == -1) { DPRINTF("Unable to fork, cmdline: [tapdisk %s %s]\n",wrctldev, rdctldev); - return -1; + goto fail; } free(rdctldev); _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |