From patchwork Wed Sep 23 12:37:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zdenek Kabelac X-Patchwork-Id: 49524 X-Patchwork-Delegate: agk@redhat.com Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8NCbVWE030574 for ; Wed, 23 Sep 2009 12:37:31 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 356E5619F05; Wed, 23 Sep 2009 08:37:30 -0400 (EDT) Received: from int-mx08.intmail.prod.int.phx2.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n8NCbR81023246 for ; Wed, 23 Sep 2009 08:37:27 -0400 Received: from dhcp-0-185.brq.redhat.com (dhcp-0-185.brq.redhat.com [10.34.0.185]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8NCbQsD009830; Wed, 23 Sep 2009 08:37:27 -0400 Message-ID: <4ABA1686.1000906@redhat.com> Date: Wed, 23 Sep 2009 14:37:26 +0200 From: Zdenek Kabelac Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090806 Fedora/3.0-3.8.b3.fc12 Thunderbird/3.0b3 MIME-Version: 1.0 To: dm-devel@redhat.com, Milan Broz , Alasdair G Kergon X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-loop: dm-devel@redhat.com Cc: Subject: [dm-devel] [PATCH] Add missing del_gendisk to error path X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com Add missing del_gendisk() to error path when creation of workqueue fails. Otherwice there is a resource leak and following warning is shown: WARNING: at fs/sysfs/dir.c:487 sysfs_add_one+0xc5/0x160() sysfs: cannot create duplicate filename '/devices/virtual/block/dm-0' Signed-off-by: Zdenek Kabelac Reviewed-by: Jonathan Brassow --- drivers/md/dm.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel diff --git a/drivers/md/dm.c b/drivers/md/dm.c index b4845b1..bf5961d 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1819,6 +1819,7 @@ static struct mapped_device *alloc_dev(int minor) bad_bdev: destroy_workqueue(md->wq); bad_thread: + del_gendisk(md->disk); put_disk(md->disk); bad_disk: blk_cleanup_queue(md->queue);