Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755170Ab2H0X5P (ORCPT ); Mon, 27 Aug 2012 19:57:15 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:55614 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755128Ab2H0X5L (ORCPT ); Mon, 27 Aug 2012 19:57:11 -0400 From: Herton Ronaldo Krzesinski To: Jiri Kosina Cc: Andrew Morton , Jens Axboe , Tejun Heo , Ben Hutchings , Vivek Goyal , linux-kernel@vger.kernel.org Subject: [PATCH 2/6] floppy: do put_disk on current dr if blk_init_queue fails Date: Mon, 27 Aug 2012 20:56:52 -0300 Message-Id: <1346111816-16700-3-git-send-email-herton.krzesinski@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1346111816-16700-1-git-send-email-herton.krzesinski@canonical.com> References: <1346111816-16700-1-git-send-email-herton.krzesinski@canonical.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 980 Lines: 30 If blk_init_queue fails, we do not call put_disk on the current dr (dr is decremented first in the error handling loop). Cc: stable@vger.kernel.org Reviewed-by: Ben Hutchings Signed-off-by: Herton Ronaldo Krzesinski --- drivers/block/floppy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index c8d9e68..1e09e99 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4151,6 +4151,7 @@ static int __init do_floppy_init(void) disks[dr]->queue = blk_init_queue(do_fd_request, &floppy_lock); if (!disks[dr]->queue) { + put_disk(disks[dr]); err = -ENOMEM; goto out_put_disk; } -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/