Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9182118pxu; Mon, 28 Dec 2020 08:37:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUMg5IfrgPQyRTb1fgSl2s3h0xZeb7B3EOvdZd0zjrNNV1wUUw4p+U3BiOqK28S4X/NGrz X-Received: by 2002:a05:6402:254a:: with SMTP id l10mr35918828edb.264.1609173451262; Mon, 28 Dec 2020 08:37:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609173451; cv=none; d=google.com; s=arc-20160816; b=qQ1eUFNUTqc+2md8HHbpx4Dvd1Jwh4JXDBdX48QjQec8wBcFugYR2gCV6OS9bAjrWb NZ03XRsv6IWdZec8gTSBBO5LHksB7lpkkwzfZ2iOHdCKL+gCmcpmnMi11rVP4VawmDzA 3ZrOuSQsM4UAao/s5V+SRlUrcznISO2V5yZeWG941uKg3lrhGb0Gz5LTlyRgw6ZKcfcY CmUBMGn5X63/mo60BjCTOxvcEZarAhnGHAaTV9yxvWg0ZNg6KSN0qlmPexVSyB2kRctP 8/8NIsqYJCqX8IEoKr6mZMdYtP+WdCTIPwF3kuhgqXP9JqzPbG4gwq+J8ZM6OiP6PjQ/ va0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Fm8ValKQfDpSx4mJYfpPuPnWhnpNRcDhQOauEDEhztM=; b=ucMCBjoHWntlFsX/n8z1myGZgZ2ZgUGRMyN8ycjQxvi7QkdrinVI2YcwRl3htNseK6 RLXQAKjY98yfezglrJCyOWYqkpbenkAlyZYRxLATdl5xwOlXBng1e1xz1P5WhtPx9gdC MQO6ifjMbQuTl0iVTVg0oaNKAipQw+AaBzUrdGhO87sNaBMi7w57H0jYqwk+HJBJLA6z T0m2NEHlg5Hl6GGFc1J/5cxaPpJU7iG0wzeMOcPk1/Ug4z7XEsokXRJQ90oXNkvXLTkJ acQgoJtyidpkIUSWPvOLgN3WilFwd/96lrRuR3/gVTr1hkCGzMwNfmj/BEFnIBsCbnv6 jGUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HDBWnfsr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c20si20556176edw.222.2020.12.28.08.37.06; Mon, 28 Dec 2020 08:37:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HDBWnfsr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730051AbgL1Qef (ORCPT + 99 others); Mon, 28 Dec 2020 11:34:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:58500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730071AbgL1NCX (ORCPT ); Mon, 28 Dec 2020 08:02:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 52EE922B40; Mon, 28 Dec 2020 13:01:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160503; bh=HSBNEKsX8x/pKFRHq7VYIHhlajyQI0o31J4rKqWI+oU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HDBWnfsrlTMPpSUDgTKHQBeaM8/wAqpXeBl8uZAt8jXzulJ24QrSNfbjQ+t82mURM Kl5D4Aq36YJbOdNz6odo5i5jxGF01YMAh50uT0RIuuSD5y4jdq09b6ZlZoS/ifIBh9 sWfh8rjoI+/dM2yO9NWstQ96O4UOX0Mmrj3C+Ldc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Qilong , Santosh Shilimkar , Sasha Levin Subject: [PATCH 4.9 073/175] soc: ti: knav_qmss: fix reference leak in knav_queue_probe Date: Mon, 28 Dec 2020 13:48:46 +0100 Message-Id: <20201228124856.773674241@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhang Qilong [ Upstream commit ec8684847d8062496c4619bc3fcff31c19d56847 ] pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in knav_queue_probe, so we should fix it. Fixes: 41f93af900a20 ("soc: ti: add Keystone Navigator QMSS driver") Signed-off-by: Zhang Qilong Signed-off-by: Santosh Shilimkar Signed-off-by: Sasha Levin --- drivers/soc/ti/knav_qmss_queue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index b73e3534f67b2..fec97882ac880 100644 --- a/drivers/soc/ti/knav_qmss_queue.c +++ b/drivers/soc/ti/knav_qmss_queue.c @@ -1717,6 +1717,7 @@ static int knav_queue_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); ret = pm_runtime_get_sync(&pdev->dev); if (ret < 0) { + pm_runtime_put_noidle(&pdev->dev); dev_err(dev, "Failed to enable QMSS\n"); return ret; } -- 2.27.0