From patchwork Wed May 20 13:34:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinghao Liu X-Patchwork-Id: 11560503 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 BAF4590 for ; Wed, 20 May 2020 13:54:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ACAAB207F9 for ; Wed, 20 May 2020 13:54:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726785AbgETNyS (ORCPT ); Wed, 20 May 2020 09:54:18 -0400 Received: from aliyun-cloud.icoremail.net ([47.90.73.12]:23523 "HELO aliyun-sdnproxy-4.icoremail.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with SMTP id S1726439AbgETNyR (ORCPT ); Wed, 20 May 2020 09:54:17 -0400 X-Greylist: delayed 720 seconds by postgrey-1.27 at vger.kernel.org; Wed, 20 May 2020 09:54:16 EDT Received: from localhost.localdomain (unknown [222.205.77.158]) by mail-app2 (Coremail) with SMTP id by_KCgAneBLpMcVev4SOAQ--.59815S4; Wed, 20 May 2020 21:34:37 +0800 (CST) From: Dinghao Liu To: dinghao.liu@zju.edu.cn, kjlu@umn.edu Cc: Dmitry Torokhov , Richard Fontana , Allison Randal , Thomas Gleixner , Greg Kroah-Hartman , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Input: omap-keypad - fix runtime pm imbalance on error Date: Wed, 20 May 2020 21:34:29 +0800 Message-Id: <20200520133432.19738-1-dinghao.liu@zju.edu.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: by_KCgAneBLpMcVev4SOAQ--.59815S4 X-Coremail-Antispam: 1UD129KBjvdXoWrKrWrZF15CFyUGr4xXF1UKFg_yoWDJwb_W3 4Yvrs7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ailing-List: linux-input@vger.kernel.org pm_runtime_get_sync() increments the runtime PM usage counter even the call 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/input/keyboard/omap4-keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index 94c94d7f5155..d13d81c796d2 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -371,8 +371,8 @@ static int omap4_keypad_probe(struct platform_device *pdev) err_free_input: input_free_device(input_dev); err_pm_put_sync: - pm_runtime_put_sync(&pdev->dev); err_unmap: + pm_runtime_put_sync(&pdev->dev); iounmap(keypad_data->base); err_release_mem: release_mem_region(res->start, resource_size(res));