Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp894602yba; Thu, 18 Apr 2019 11:21:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOdNJEomQ8A1H7mrnjQvjkUmBt3sWF0yc2tJ6mmB5jfKHZDro29wIwweyTdHgiT+fDUQb7 X-Received: by 2002:a62:e80f:: with SMTP id c15mr97343449pfi.93.1555611673690; Thu, 18 Apr 2019 11:21:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611673; cv=none; d=google.com; s=arc-20160816; b=t4n/XLU462q9nHYX1C03WQA3RYEm4NNfWEFNsRy9UQs7Lhs9LHclFmMDtX0hlyL0uO 2TOT/9sXZOH5B6lKQBdMhfyqMQW0ocNZdJ4p7xLva7PgmZ/pJMYvAaz+4+2fJDvDcDDU lkGgBPT3+AFoAHz565+wmIkHHXGrl/iQZJzg8DrJt0OTPDRE0VF9FfRqHiqQN8tUB0Mv Eq/NVNRIZPan/Yn322qU8AOdTK1bpACDN/rkWt2TNVJISbgeMaPwWL1992Esjk+/FcHJ 1yslIcs2E3JsKn1QUnRcWIANmrP0UP3KHJmLWEiKSx9brr28GT8r6l/hXjiiZReXMog/ WZHQ== 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=UUVjKVtj0mP6fq8hUJZU4e8kqRVbAgQf0xdPJ4HWpM8=; b=uHExHSBeKBPjLnOx9GGBHuqDFBCC+FjXcWNiPRPy/tBNG4zyZvWUzbBwvhGbrJy2DR EosdWSmVYZ49o0XK3Hoj6KnFxPLh9CcjoZnEsw/4XYur9eM5EQBHExisEEO2NLhw++6Z m386U0vtI6+P24PWxTb4TrtSGa4fey2ypmtHik5/jKRJIls9ulIcFi1woV+LLF05UjSY hKlK88iYJyh2fCt3sKeJDzGmlNo6rtdAs891+Oeeb1xWaKZ0+G/zciXmd1a1onTKy+md EJMuEhQiOkdocgOxMEaXNHKrmsm7wFgAbtpv5aQwqUCTH58MZnf7wEhuvKR9Oe8/gN1D opsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T67lxVDh; 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 y12si2806921plp.47.2019.04.18.11.20.58; Thu, 18 Apr 2019 11:21:13 -0700 (PDT) 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=T67lxVDh; 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 S2403988AbfDRSTT (ORCPT + 99 others); Thu, 18 Apr 2019 14:19:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:41622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404005AbfDRSJz (ORCPT ); Thu, 18 Apr 2019 14:09:55 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 E58BF20675; Thu, 18 Apr 2019 18:09:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555610995; bh=qd9iump0SQrd0bM6BCRKUKBYCAYpxefPEQQ/BmPORJk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T67lxVDhwfDqwzlhWXvgVVWdpPrNtEy/8v0cWMYVa1+/aaWPnPgEW31Zg4OV2dNTL xZgGMs+5K11DBY6NbyEAuT1RI86OO+fK7IOJC5Z5NdPpq4rnZOjIP4Ve+hSYoNMSqa ckDngl/O277nq0riF2xL4ipreFgELJlsbHu0zVPU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , Jens Axboe , Sasha Levin Subject: [PATCH 5.0 19/93] paride/pcd: cleanup queues when detection fails Date: Thu, 18 Apr 2019 19:56:57 +0200 Message-Id: <20190418160438.746819159@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160436.781762249@linuxfoundation.org> References: <20190418160436.781762249@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit 81b74ac68c28fddb3589ad5d4d5e587baf4bb781 ] The driver allocates queues for all the units it potentially supports. But if we fail to detect any drives, then we fail loading the module without cleaning up those queues. This is now evident with the switch to blk-mq, though the bug has been there forever as far as I can tell. Also fix cleanup through regular module exit. Reported-by: Randy Dunlap Tested-by: Randy Dunlap Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/block/paride/pcd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c index 96670eefaeb2..377a694dc228 100644 --- a/drivers/block/paride/pcd.c +++ b/drivers/block/paride/pcd.c @@ -749,8 +749,12 @@ static int pcd_detect(void) return 0; printk("%s: No CD-ROM drive found\n", name); - for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) + for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) { + blk_cleanup_queue(cd->disk->queue); + cd->disk->queue = NULL; + blk_mq_free_tag_set(&cd->tag_set); put_disk(cd->disk); + } pi_unregister_driver(par_drv); return -1; } -- 2.19.1