From patchwork Wed May 20 08:06:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinghao Liu X-Patchwork-Id: 11559657 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6987F913 for ; Wed, 20 May 2020 08:06:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59E5A2065F for ; Wed, 20 May 2020 08:06:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726525AbgETIG6 (ORCPT ); Wed, 20 May 2020 04:06:58 -0400 Received: from mail.zju.edu.cn ([61.164.42.155]:39388 "EHLO zju.edu.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726436AbgETIG6 (ORCPT ); Wed, 20 May 2020 04:06:58 -0400 X-Greylist: delayed 679 seconds by postgrey-1.27 at vger.kernel.org; Wed, 20 May 2020 04:06:53 EDT Received: from localhost.localdomain (unknown [222.205.77.158]) by mail-app3 (Coremail) with SMTP id cC_KCgCnr0MB5cRegS7fAA--.12113S4; Wed, 20 May 2020 16:06:31 +0800 (CST) From: Dinghao Liu To: dinghao.liu@zju.edu.cn, kjlu@umn.edu Cc: Corentin Labbe , Herbert Xu , "David S. Miller" , Maxime Ripard , Chen-Yu Tsai , Eric Biggers , kbuild test robot , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] crypto: sun8i-ss - fix runtime pm imbalance on error Date: Wed, 20 May 2020 16:06:09 +0800 Message-Id: <20200520080617.23801-1-dinghao.liu@zju.edu.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: cC_KCgCnr0MB5cRegS7fAA--.12113S4 X-Coremail-Antispam: 1U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jiaqtzq6lmxovvfxof0/ Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org pm_runtime_get_sync() increments the runtime PM usage counter even it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c index 84d52fc3a2da..b1c766bf4483 100644 --- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c +++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c @@ -359,6 +359,7 @@ int sun8i_ss_cipher_init(struct crypto_tfm *tfm) return 0; error_pm: + pm_runtime_put_sync(op->ss->dev); crypto_free_sync_skcipher(op->fallback_tfm); return err; }