Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2999596ybi; Mon, 17 Jun 2019 14:22:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9PuxU45B9pND9+3RyQAxcC+rsNSCHFdhRGYT5srImewarLvAIfR3xKRFNaB3O0djSDdLO X-Received: by 2002:aa7:972a:: with SMTP id k10mr82660220pfg.116.1560806561863; Mon, 17 Jun 2019 14:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560806561; cv=none; d=google.com; s=arc-20160816; b=qM1FihpMz9plhix2OCeVTFK7/JBJCrCQa05XCFYu5G/UUnIbylijxmg4XLcc/zxemx aB6l8muR2RXgATNXE5bUNJjGC28HPAs1xO2U8IC6eo685wDohYW8xDSAxpR4+YmGiwQ0 LaTfvP6sVX+q1ZAcPMDQADewuXWM6JC79bQM8lMzIV5GJ9A+ub4avGLBWu3u4EHAwzJM BIynoyKCfsUiKfAGqpxB16G2cGdOGO/BIz9X4oNPD5XdxPvbV+oJiyCp8BJNKJgjbXi0 QS/ErMpRY0O2XMdu7K+z9vy+M+W0xEPkREO5pkV6RIVLTgSIclkfhUjEEtQ/fBb+9Gdx Vi+g== 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=p9pieJoQBl4IRBw1+NnlwPxr6PiQD8xeI0+S6a2auv4=; b=pwIacswZUCx2YaQlhUL2qWVeHpbePPgfUuuewuMvsrXbi/h5zjqGm8TEBsSbNjlqib qMTMsWvkxTrq3G7JPijTSAdtlC618vm9JFcDVlIyY/7XMurQysK1oOHdK0ClD429iFMJ z5R2yeAJSvv06OzFGwXHfUnhnc201YBnZ0anDOLrSrSGtzfIxz99lcQ3y17tfX8x8DmW SOVTvH7qmvbfHg8GkO6+Wu9CnNZiL6iB91H2ESD8CbZcbZCfEJ8lPstJ+KXFECg50w65 RJzq8/cdyWrD2yy2ylCOjOeLwalQu9HAwXksW/9m6M+3biOtzQ30kbUgwjaYI2srCAUz rx9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1sxc+4GF; 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 f17si321296pjq.18.2019.06.17.14.22.26; Mon, 17 Jun 2019 14:22:41 -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=1sxc+4GF; 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 S1729375AbfFQVVe (ORCPT + 99 others); Mon, 17 Jun 2019 17:21:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:46050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728900AbfFQVVb (ORCPT ); Mon, 17 Jun 2019 17:21:31 -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 1EBA620861; Mon, 17 Jun 2019 21:21:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560806490; bh=kl4VkFn/kIn6Kaes2768yCdGWHalmqI56eqE0eTfxfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1sxc+4GFIG1smomkpezkSTbgGL6vlLW7JRHivTiNTacBhdTTciS+tqJw1KsnL/hx5 TxR51ZxhbCU5OFkuydZYryIcPJLTNocH1VpnsD1bCG3KHLME1emlCTIwI//qPU07gi fkJCeTUUDFNQvSs9Fg9WS4WOymliFOTe+AXUnnyo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Keith Busch , David Milburn , Yufen Yu , Sasha Levin Subject: [PATCH 5.1 070/115] nvme: fix memory leak for power latency tolerance Date: Mon, 17 Jun 2019 23:09:30 +0200 Message-Id: <20190617210803.656145049@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190617210759.929316339@linuxfoundation.org> References: <20190617210759.929316339@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 510a405d945bc985abc513fafe45890cac34fafa ] Unconditionally hide device pm latency tolerance when uninitializing the controller to ensure all qos resources are released so that we're not leaking this memory. This is safe to call if none were allocated in the first place, or were previously freed. Fixes: c5552fde102fc("nvme: Enable autonomous power state transitions") Suggested-by: Keith Busch Tested-by: David Milburn Signed-off-by: Yufen Yu [changelog] Signed-off-by: Keith Busch Signed-off-by: Sasha Levin --- drivers/nvme/host/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 23c90382a515..35d2202ee2fd 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -3699,6 +3699,7 @@ EXPORT_SYMBOL_GPL(nvme_start_ctrl); void nvme_uninit_ctrl(struct nvme_ctrl *ctrl) { + dev_pm_qos_hide_latency_tolerance(ctrl->device); cdev_device_del(&ctrl->cdev, ctrl->device); } EXPORT_SYMBOL_GPL(nvme_uninit_ctrl); -- 2.20.1