Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp191646pxf; Thu, 8 Apr 2021 00:19:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaqP9zaQxGCKYOCvoM0dLvITDlDjbiE0x7JA8Bfi5kGH2SyxJ/9/fsRDu9l6dxGbnizqPK X-Received: by 2002:a17:90a:f307:: with SMTP id ca7mr5997748pjb.80.1617866382364; Thu, 08 Apr 2021 00:19:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617866382; cv=none; d=google.com; s=arc-20160816; b=qubP6bHoV8pNWWG8wHiT3ENEXPTKHiwMSh7y9qXpLTP+EaABtN2YcXAxnzarhijHow 0STSP+UellFGGIilbxQZ4on6NtSgxR61WxQ/yCLZYCaRvxsVCqob7TO2GwNoN7gRA/qJ Uc5C4V+hnZS+0ymM5gTKlGGdIKuZeyf+sHUM9qa6avUDbiododFyquIdphgtG71Vo6AV j38Q5rmt/fse148df8k1wshS0QJrVGXbe1UXqz+oW7IZYjGz/5l/jaePpHoxutXpQrFe YNT8FmoXYAtY6aE+D9BvlM1quX/TmBTi+OfrgH1mFSIwvzX+3x3DrkUvHmN3HzmOEC0l y9RA== 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 :message-id:date:subject:cc:to:from; bh=kYOT2hN86Sm3txRmfEHRQoE5em8z/LuY4auXlsdqmCw=; b=HdBbr7DB5Y4/mGEInOLPMmXQ6W8aC03RtZFrFSo/s1ZKHNGlvWLgaueRevruFb25eX AhdKsAYdLloYC7ddAmLhmBXWH+CJ+YNk0dIsDNnubJ9W2NiOfalZpdhkM2+wQaZ7TpYh e38zYjz2V7pAFEFWLOcOh9Ox5FA/K//aZIE5e0YoyI//AvCPNJDJqHaUUAsfyq2xtxKT BKgkBzmHVPfxRG65DSoiILJ5MffETHjj6Yst25ZNhZvxufsbE0sSLWKJXrxPIMeYx6Wv QBezWRsXzxnBjnKmchiRZKu96miF7Qrpb+sIxKQ4Bmly1SDVN+UhZqU/IMkxSqxsJliB rFCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c23si9022217pja.75.2021.04.08.00.19.25; Thu, 08 Apr 2021 00:19:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229834AbhDHHT3 (ORCPT + 99 others); Thu, 8 Apr 2021 03:19:29 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:16825 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbhDHHTZ (ORCPT ); Thu, 8 Apr 2021 03:19:25 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FGCHx3m6Kz93fM; Thu, 8 Apr 2021 15:17:01 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.498.0; Thu, 8 Apr 2021 15:19:07 +0800 From: Shixin Liu To: Corentin Labbe , Herbert Xu , "David S. Miller" , Maxime Ripard , Chen-Yu Tsai , "Jernej Skrabec" CC: , , , , Shixin Liu Subject: [PATCH -next 3/7] crypto: sun8i-ce - Fix PM reference leak in sun8i_ce_probe() Date: Thu, 8 Apr 2021 15:18:33 +0800 Message-ID: <20210408071833.836741-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 --- 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.25.1