Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3491470imu; Sun, 11 Nov 2018 16:18:21 -0800 (PST) X-Google-Smtp-Source: AJdET5fx6zB/fmtQNfXpdLkL5s0eTQ5dFghaM44fh8T4y99a3BwShC9PVOuLf9/JKyUjWYbUoaQe X-Received: by 2002:a63:cc43:: with SMTP id q3mr15333042pgi.291.1541981901025; Sun, 11 Nov 2018 16:18:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981900; cv=none; d=google.com; s=arc-20160816; b=JyVMB7pKfZALk2i5+DORHbMzmQJQwxpgUWmDWIVaK/DChs2WHNSVry4RdHTT2BnWAY WbnxU6bkaEy3+F0VDjFkJXQeFYr6f+rH5VnqfCB8UBvs43HRisJxVA51Jeimx0dC29Q3 E7tdum+mMx//wYqasI1fds7c8zKHZ8gbehiTyeYVajgGzwdoniV+Fq7UZ7j2PKR9TA2+ inZTARJ0DZIqT07Kj7ddUAWAMTsnX55/6c7NrbLqDN4+veJPnVfZD7VhEpBogVE5qhlL 7pnAO+m9dYANU/YcL/M4cdDu+n+7grPobNxbOPLAG4BUdDV1jSQRnUa8+1r9vrV/aRzN 2SfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xFiPcmOl3AOgCQAheqATFwLKgP/iBspNxAinqoSiKmI=; b=rh6eipBWVMC5ilurRpGXFtbPyF64rVTUpKA7kTwqyJpzP/MNLrUvaoZuAHtHo9Scv5 FwX2/MDAnbn0ljV5bInuUXF0kmr5sFLHgxYmei9fuHEPhC2ScgiycZQi0mIkSrUg4vel OGdyVyClO5yqAe3dFtJM/p8MS+koZVbdOcTEq4d/QvcArz6qjmFyw95B9mmwnr0Kczr8 5r2mBBBcmEd+l/9UanSjGPM4JruhJX4bngVCJsrtgtfxE0RWyoaMky0fgLfT76cX75bQ nkwmpxcYixlllRand5OmJEY6khEuSaxEn7lLb+aVXvV61QsjuNSSV7uVkGoCghEuXL6v qRww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=N0Px5jU8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w64-v6si16330336pfw.101.2018.11.11.16.18.05; Sun, 11 Nov 2018 16:18:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=N0Px5jU8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730357AbeKLKGx (ORCPT + 99 others); Mon, 12 Nov 2018 05:06:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:59016 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730143AbeKLIRF (ORCPT ); Mon, 12 Nov 2018 03:17:05 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0EAF721731; Sun, 11 Nov 2018 22:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975230; bh=Xr8FZkb3HCb9JMRi1reZF4/jkW8cBy1hRZ8zgeR6wWI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N0Px5jU8aIbNdQMwQKlJyLO4FrNPKdiA0BuBj7e1w4M4k2yHVHFyXbXRnovEaSMQS 0eGRHLFa5uzkEZN0+i1lSA/K2UbU4+uAKg6ZqvyYJZ9mZsuyeuBwLGPBt/edw8gSMq etD5n6Io7d+H6InVV6nnId1WOzBujHcM8pMhRUX0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Omar Sandoval , Jens Axboe , Sasha Levin Subject: [PATCH 4.19 053/361] swim: fix cleanup on setup error Date: Sun, 11 Nov 2018 14:16:40 -0800 Message-Id: <20181111221627.524949331@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Omar Sandoval [ Upstream commit 1448a2a5360ae06f25e2edc61ae070dff5c0beb4 ] If we fail to allocate the request queue for a disk, we still need to free that disk, not just the previous ones. Additionally, we need to cleanup the previous request queues. Signed-off-by: Omar Sandoval Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/block/swim.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) --- a/drivers/block/swim.c +++ b/drivers/block/swim.c @@ -887,8 +887,17 @@ static int swim_floppy_init(struct swim_ exit_put_disks: unregister_blkdev(FLOPPY_MAJOR, "fd"); - while (drive--) - put_disk(swd->unit[drive].disk); + do { + struct gendisk *disk = swd->unit[drive].disk; + + if (disk) { + if (disk->queue) { + blk_cleanup_queue(disk->queue); + disk->queue = NULL; + } + put_disk(disk); + } + } while (drive--); return err; }