Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2476201pxj; Mon, 10 May 2021 04:02:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLlMiZjBtRZYzp+hwN8kpW0+QM0P1x/Iwl5JzrInIW/NQ0L9L2g38uT3Sy69qbqvB8Ng+v X-Received: by 2002:a05:6602:24d1:: with SMTP id h17mr16896353ioe.99.1620644558168; Mon, 10 May 2021 04:02:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620644558; cv=none; d=google.com; s=arc-20160816; b=zFEvXeWvDgPzLjQQ4ByB61AK4kwGb9DPgd1RYY7ISwxu0SYEb6QMv+kR5V2iExRQ4i A2DBi+wbwyvIoZ3t+a0iTkDPggFROIFZTou4aWWlV1USxzEl+Z9GnF+apXmAEEfJTCNc lIJSsNYijY37VG++YgWVRJyZ0ixxm8uqjN1AY9GVWXxuil4or0nXZ/QfaF1K6uPaFIgl jNBvTj+UM4hCguJb8rw19EA2AEyodGfZGjdXXymAacZ+IGAjVGz4wvMdOK1pLZEG/+lk jMkhbCs4d0oFVQHKm+mqNkY+pWWezoS/Hn1EyrUF6bnDg7oz6bS14AlEP67JyUjFfCrC vChQ== 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=AkHD3+PNgbq+PeawplTjyY5CA++3m+7d2A91+7Lyi7bTZe8GO4cGoVRea1o8hSaMVT 4PFpwqYCIGLYWu/ySyQYA0M65WMBAkkRWvjXYm/5laLBAH23+dCSm7FPWq3oCj6MXML6 SjoWtxb49BZAZfGXDcyNuGWbMaffmFgE6vMs6dzQMblwK45Jzhsgl2MfMHPTfe+67wPR wF034KosUF1HTG/2vkcmh/54sTxvHMMGTfwnfvKXJKJhiVMbK/RYy6OHoxM0YjBvwHVx Biv+mZw1/E4lnVudHEbNkGUVx+cSDw9Q32gC+Hstynlgu5uSM+mHVD+ld+sZGgWCCHnQ CKvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="T4Sb/YAb"; 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 d7si16341499ilg.78.2021.05.10.04.02.23; Mon, 10 May 2021 04:02:38 -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="T4Sb/YAb"; 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 S235263AbhEJLAd (ORCPT + 99 others); Mon, 10 May 2021 07:00:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:59618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233175AbhEJKpQ (ORCPT ); Mon, 10 May 2021 06:45:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A73716145F; Mon, 10 May 2021 10:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642914; bh=qvblGfmtxj+gEH5BY1Zj5qnAC8tMmxJXYplIdEgeS/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T4Sb/YAb9kM9PCyTTGiMGHW1FBdZrlWT3JARU3hGaCu/MPWb0DXV3vROO4I5IEAYS qOVmRx0FXMcqTDbryNRpd9N5CAuplrw2xuZ90a1EWmpOYpGS5ilHvSsljauqoT76hF xSk62bDT7fLdigys/r49G9viZsrEplLZzMtG8XB8= 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.10 103/299] crypto: sun8i-ce - Fix PM reference leak in sun8i_ce_probe() Date: Mon, 10 May 2021 12:18:20 +0200 Message-Id: <20210510102008.346391593@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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