Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2703593pxj; Mon, 10 May 2021 08:54:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzt1ACwB0RHLARfnG9iJZB+FhQYraYfRl8R6r3/riLn9CxuGEYkN08yI49JNWbScprteWsN X-Received: by 2002:a17:906:2c4c:: with SMTP id f12mr26180249ejh.3.1620662064387; Mon, 10 May 2021 08:54:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620662064; cv=none; d=google.com; s=arc-20160816; b=0sGnQKq39A4vo6wIxUdyZwRwoDN0lBGWogS67xZeQuyJbyNlOKDw/nX5bpB+IJpFI0 L5rWCQiaULprau8pz1CV4BogSUnU72v01STtWd3lu7HLBtMdQ+G06fKBz5o4M2XlKILB W0j7Jms8P8quSHdyhszZtaZBYxv48PPpZamWxFDNIoGGgWKXJEqymUvG2d3UKHuJOjWL aM9qr0DYOMLXHpQs8s3yHJbaPGMnCUa5oISVd8bYffuW7G0MwXMPJerCRZazS170Q2yX 9//Py9A2vnItTqLEVp1W7BINuh9Eb/hpXpo537HnPtY+XvWU3wxPwtEkSGqtyHWlQ+lT s7Sg== 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=pwjHevINymSQCPG4coeEEU8b2mB1TBKHgJFvwH34YMw=; b=Y+MWDgXTDKfE0E38gMY+9PkV9QH/oury1xGp+vAvZTmoXMh2Ul+cyyZIrskf/XrMs0 JQ31S2ePr0L7tqel1wX6o6oUHwS4OuOUQNbOhQQ/tBTqve1KBp280FjPGf6C/gTYo0K3 C//rACVO7xMsH7b9ylXwqO6CMuk65wCg/1kGiYDMI8oMuefIUEBqUVFk6U6HWcHGTZmB nV7Qk40DEULVf1JlzTv32SwBQ+VWYGhlYMo4c3ybN/L2zRo0C+24Kgqwn8to723adNjo SIKCjgEhU/ZPPjQ2jLIqXwXB4GHNgxdhKGeeOUX+4JbZEc/jvVsJj1UqDvKtFMiaEzNL Jc7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sMwgqTJL; 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 jg13si18012658ejc.430.2021.05.10.08.54.00; Mon, 10 May 2021 08:54:24 -0700 (PDT) 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=sMwgqTJL; 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 S240283AbhEJL2u (ORCPT + 99 others); Mon, 10 May 2021 07:28:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:53004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234688AbhEJK4v (ORCPT ); Mon, 10 May 2021 06:56:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 78D29619AF; Mon, 10 May 2021 10:48:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643690; bh=qvblGfmtxj+gEH5BY1Zj5qnAC8tMmxJXYplIdEgeS/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sMwgqTJLEChMpl8w+aPJI6kUO7FOTUw4ojJIyR8d34qjnKS83Ydpeuc4m10PPzYi8 2Nmau1XvVnyMTwYNTSIocedqj0xbOa+Y43pezAORIhSiapHtH7F6GacwgZ/ts4pNtu UvrDvskCRE+OBuu7mhjmz3EUygH/mguYcpYMlehA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shixin Liu , Herbert Xu , Sasha Levin Subject: [PATCH 5.11 118/342] crypto: sun8i-ce - Fix PM reference leak in sun8i_ce_probe() Date: Mon, 10 May 2021 12:18:28 +0200 Message-Id: <20210510102013.984689991@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102010.096403571@linuxfoundation.org> References: <20210510102010.096403571@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: Shixin Liu [ Upstream commit cc987ae9150c255352660d235ab27c834aa527be ] pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Signed-off-by: Shixin Liu Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c index 158422ff5695..00194d1d9ae6 100644 --- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c +++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c @@ -932,7 +932,7 @@ static int sun8i_ce_probe(struct platform_device *pdev) if (err) goto error_alg; - err = pm_runtime_get_sync(ce->dev); + err = pm_runtime_resume_and_get(ce->dev); if (err < 0) goto error_alg; -- 2.30.2