Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2345281imm; Mon, 28 May 2018 06:27:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJKgX+cFsMapy2jD/SDMekPoE/KJGD00Pi7fndcV/C3JRoNhSlrIaX2mb9mUur06m9UHWfg X-Received: by 2002:a62:4e07:: with SMTP id c7-v6mr952075pfb.149.1527514033275; Mon, 28 May 2018 06:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527514033; cv=none; d=google.com; s=arc-20160816; b=Z4ldeC+44iuRD44RbP3MaxsyuRUFrN5CWL5wysUnAoLegaN7t0yyN8FZFCxxYq32fx OstY+VvhzQYHbokCPxzlk5Pe6lNbjsRbAKJXLcB7MKr/2RcXfG2f1jV2fBHrcZViLWwp VGU8H2DkDAGwpkFX29olkpz0sYz6G99nDJvaWpyDghGVG8psRrFjw+or9te3D6R9vRAV kiiX0J1a7Cy246Y8AOn5GUc3GOCwHnX6HDXxG3SjNfxMsemGPran6+EvWBS86E/iFooh NYuDMn1UNWD5zuYHdFpp56r1VIGsndjEbmP9iqj1ULF7zpYIFdzgX7j9Ewj1YCjw9N/M iKNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=rupAvHVcmzq0xc11BQK/B3YM0UT2FxXsPwHuYw/pONQ=; b=I6VEnrkCSh20KA+mlEAIpqc09p14G8M0LiWDc/hvNOLw+W1CfFRNQSEQYHNbK+2apo ZOvRGcCTIYPJAqMCRLuF0rQXzVvHEweR836UvPlTtF8GFvRAn7COAwWjPgdPaTaFIiUx KiAVOdWpwDBdmcEiApfq1kvy1O8E65wrR2OrU/DiupeHQ6XmPvr/MksXoWUmf09stY88 9uv4KLjghQI8xE1sqQONRZatorkzpt54OsexpigLV8BaXVD2sD1UWXQ8OINre6iKI4NJ oZnpMJvc6OQu2HXoe1Uu3aSA3GhxbsLUhKo/Et7EBPe0e+EjD2Bhk/en+hoPHsd1GX3R +1vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=grIpvMJO; 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 d7-v6si31057845pfe.214.2018.05.28.06.26.58; Mon, 28 May 2018 06:27: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=grIpvMJO; 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 S1161064AbeE1Kr7 (ORCPT + 99 others); Mon, 28 May 2018 06:47:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:37888 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034302AbeE1Krw (ORCPT ); Mon, 28 May 2018 06:47:52 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 3D2C3204EE; Mon, 28 May 2018 10:47:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504471; bh=WeLnmitMl6YQYCVNoy84BZWsrx6RMxc+TSvTQvPIpVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=grIpvMJOmF+5xwjqq3dC1WwMaVerSr5KKKx3UD7JcZ+g9FZoh4sAUZDiVCkjz3XvB oIz/U7WSaQFPZpFixeWBXRX0d45GaETGumaQ9U56pB1Y6eAHFThD2+D2gLdgcaS3Cs Dhxk09cE2gqhAJ9gwvq9MzF96C5elsthX9XQodVQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jianchao Wang , Keith Busch , Sasha Levin Subject: [PATCH 4.14 151/496] nvme-pci: Fix nvme queue cleanup if IRQ setup fails Date: Mon, 28 May 2018 11:58:56 +0200 Message-Id: <20180528100326.259438083@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: Jianchao Wang [ Upstream commit f25a2dfc20e3a3ed8fe6618c331799dd7bd01190 ] This patch fixes nvme queue cleanup if requesting an IRQ handler for the queue's vector fails. It does this by resetting the cq_vector to the uninitialized value of -1 so it is ignored for a controller reset. Signed-off-by: Jianchao Wang [changelog updates, removed misc whitespace changes] Signed-off-by: Keith Busch Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/nvme/host/pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1322,7 +1322,7 @@ static int nvme_create_queue(struct nvme nvmeq->cq_vector = qid - 1; result = adapter_alloc_cq(dev, qid, nvmeq); if (result < 0) - return result; + goto release_vector; result = adapter_alloc_sq(dev, qid, nvmeq); if (result < 0) @@ -1336,9 +1336,12 @@ static int nvme_create_queue(struct nvme return result; release_sq: + dev->online_queues--; adapter_delete_sq(dev, qid); release_cq: adapter_delete_cq(dev, qid); + release_vector: + nvmeq->cq_vector = -1; return result; }