Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3440034imu; Sun, 11 Nov 2018 15:08:32 -0800 (PST) X-Google-Smtp-Source: AJdET5du+HxZj0BcAJd1mxAqCg5HYaMzFknheY09Npd1KcCoH/MuMjr6b9f2BMz0vDQr8g/WELUF X-Received: by 2002:a62:2211:: with SMTP id i17-v6mr17629907pfi.35.1541977712563; Sun, 11 Nov 2018 15:08:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977712; cv=none; d=google.com; s=arc-20160816; b=O7nx7er3k2lsReu0C3wSgw0dAvFiTcItegWWu4U3UfAulqYc9xqj8mmKshtAGVvs/O 0vVNUmfJ7IYY6XmnmfgjQU3gldrv2ckRzDsz10k+2UsinKmk345ShUTqo/4sveL4Hzq8 ruuUiZKAZNjD3ZLxIbO7k4pNkNDp5q5Mg9ynnd2bZWznyacwqz7e7rZtr8PkFmT4mHYX +Ol9BIdhr957pZRuFdAQ6vQmfTtMmWH5IWJkry1xeAiVbzxHtbHt/5ZYHyCi9/9ZrOx7 BvJ8X8yDEOJycvQLsWpRGjN2um6Xiryg07Y6GiYAFXN46XxkbRF9Y85kXyK+V6UEQwKo PrZw== 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=GO05ppXCs0XuoLACFG6EVD8vwP/mKTQAvdKW8z9rae8=; b=iJF2NTKGzY5WUboJ6UVViKUaQZXXA9Z2chwl8dN0sL5KOD4mYmvfo1sNp9qZT+Rf7r KOLP7x+xLPzRHH7U1z++wVD1RCOI6naBaUB4XDIcqfjMAKWnHYsVfFLpNpksYj0diXg/ t4K8nIagbXgwPw4THD3nyzTNZimzVjpWG/wXZpb3PD0JDQbKcN5uYBwaHfEGe04vdFRk 8JjpWGu+/Sm7H3DsPN4Yc5S8ph9QPc2U1JFmmlZ9E9CsxhwCajONRergf2LkMbS7jboY NPWu0KI3mXuHqdNH0lEUJskdi6/9COucvwUoxsDS6bRLuL5H8ekd45pfAhG6PUVgSv73 1PiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E+0dXWuW; 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 m8-v6si14120883pgk.424.2018.11.11.15.08.17; Sun, 11 Nov 2018 15:08:32 -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=E+0dXWuW; 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 S2390387AbeKLI55 (ORCPT + 99 others); Mon, 12 Nov 2018 03:57:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:51332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387400AbeKLIWI (ORCPT ); Mon, 12 Nov 2018 03:22:08 -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 9137E223D8; Sun, 11 Nov 2018 22:32:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975531; bh=OShEeE+0LUVUJUhZzyn6f9PJSApwwabKwuNpuS+gpHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E+0dXWuWMtxk9y0Ht+W0yR4F7pVfOjMfS/d4UloNIpdesZ2AkqY+Oi0Snmw2DKPeG fzQrkqcwDpU4IK6jy6ZmM9U52u3SvvhmuRW6uTChoPjkN/DhF+UOmpilKjre8CBG5d wdw1/a+g1enrIQIzem4YzdxVcdA3gy0eatvzRn94= 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.14 041/222] swim: fix cleanup on setup error Date: Sun, 11 Nov 2018 14:22:18 -0800 Message-Id: <20181111221651.842672483@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@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.14-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; }