WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-3.2-testing] blktapctrl: Fix a potential device min

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.2-testing] blktapctrl: Fix a potential device minor number leak.
From: "Xen patchbot-3.2-testing" <patchbot-3.2-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 06 Mar 2008 00:31:07 -0800
Delivery-date: Thu, 06 Mar 2008 00:31:44 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1204733960 0
# Node ID dfe09df4e588984f7befd4ff30439ce3c29e904d
# Parent  2156219ec80884c2f8b32ccfc2d18207bdd07aa9
blktapctrl: Fix a potential device minor number leak.
Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
xen-unstable changeset:   17172:990eb630033a53d5c319376c022283b192890882
xen-unstable date:        Mon Mar 03 11:08:10 2008 +0000
---
 tools/blktap/drivers/blktapctrl.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -r 2156219ec808 -r dfe09df4e588 tools/blktap/drivers/blktapctrl.c
--- a/tools/blktap/drivers/blktapctrl.c Wed Mar 05 16:18:45 2008 +0000
+++ b/tools/blktap/drivers/blktapctrl.c Wed Mar 05 16:19:20 2008 +0000
@@ -515,7 +515,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++;
@@ -524,11 +524,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);
@@ -540,7 +540,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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.2-testing] blktapctrl: Fix a potential device minor number leak., Xen patchbot-3.2-testing <=