From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1836EC433ED for ; Sat, 24 Apr 2021 06:48:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F1A2F6144D for ; Sat, 24 Apr 2021 06:48:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244336AbhDXGsl (ORCPT ); Sat, 24 Apr 2021 02:48:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:35972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232742AbhDXGqN (ORCPT ); Sat, 24 Apr 2021 02:46:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 57D6261626; Sat, 24 Apr 2021 06:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619246733; bh=qoORv18jmoZdLwiy2XtjoLyEheeVP14AOEUNQBQWQJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ieDxBAbfFaxqZDSr+y9csJifDJsicJVEQJ0wjfRFLrBtUEf5xhPDf9t3dMZ+NzXzF J3jyIVhgdw5MLa//cBQu53DmuRneAdy2MrtXu8J3K0WnGtgv64BnxrKP/a8xJBEbH/ sjuXjAqOtuSFABLUYt1CiN+OUI9DQCTIGihSXsVlA2wwnybntBsDprsMv+XRAnl8mu STkF76aBxV2Bgturo3rIVJLeNT02rVnv8WP0fOkSrd94lZfiXAE+mbyS/sAiYL8OeA qNE21qdWvcfAUNU43NSoT7NIRFlTRz6HbYH5KchIj3O/NrfV87aqbvxXq09vnMh5E8 HeKxOL8gjn+cg== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2l-004Jep-Hm; Sat, 24 Apr 2021 08:45:31 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Mauro Carvalho Chehab , Maxime Ripard , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 23/78] media: sun8i_rotate: fix pm_runtime_get_sync() usage count Date: Sat, 24 Apr 2021 08:44:33 +0200 Message-Id: <4be9eda76abe0279438375abb0204bcf96aeb618.1619191723.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The pm_runtime_get_sync() internally increments the dev->power.usage_count without decrementing it, even on errors. replace it by the new pm_runtime_resume_and_get(), introduced by: commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") in order to properly decrement the usage counter and avoid memory leaks. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c index 3f81dd17755c..fbcca59a0517 100644 --- a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c +++ b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c @@ -494,7 +494,7 @@ static int rotate_start_streaming(struct vb2_queue *vq, unsigned int count) struct device *dev = ctx->dev->dev; int ret; - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); if (ret < 0) { dev_err(dev, "Failed to enable module\n"); -- 2.30.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE46CC433B4 for ; Sat, 24 Apr 2021 07:07:56 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 81A906146D for ; Sat, 24 Apr 2021 07:07:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 81A906146D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2f2OwNyEHyJeLTKqvK1J4IjCZDm+XVTQk0fH/DoGcvA=; b=qR2FmrXdBO7g3aUH1z1CIIu9X np+MatKM8iaDPM/K/Gfh1YQs8ZhbbM8RBiGWxsXh/6EaJGISMOgFFTA4PsShjjlLw2y7lU8hYLnLQ Bod5RExU3MmRtlOuZlqVFSkj+8slCbUmjadlZpUhROqGs7xY3vkEjWgHeK2FNeuUKld9sw8aoiXsC Vm0MuaiqOoS3npThcjgA7gnguIW5vTN/ohgIkYNw/3cufcnXkhMkQWRTciy7HqhlGhqjplP5Pm70V PkRx5aBWfHOxv/wRM2GtN9sO+0KDfh8neSsKW9F0uc5jyXzext99pwJSRvcDWIKvkL1GgLDpWOUwP 59ICcR69Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1laCIy-003DIc-Fc; Sat, 24 Apr 2021 07:02:16 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1laC5G-003B17-LN for linux-arm-kernel@desiato.infradead.org; Sat, 24 Apr 2021 06:48:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=Wr8cem0Apl/gSqrcJ45uPbdH0/0UFTj9u4p6Unjg8y0=; b=gkuDVvsFuwrklf61Ct9zw+cOxI gkeILOiIuLRZ3oNPL5HNkjLEgSoeDhsE5ebIhUFZ8MqjpvGDseytXlRVYBo5c9nJxtCNMvGI27Lp0 3qbcpVA7gIJRrRcEtRgD8dfyYeMtN1K3aBKhSExmcZwVvebzS/7JZzLcbEGTPFKcAIyPLtcFT+FGE EJXjm7Y17ORHNGQTEjwIFBoH5uVXVlg7wT2S4e6GozuFtEbmSI67RzRWjlOQ4RdfEe/lEntclJ/Ms 4883eK4p7bE7ySVGudw01UfyaohybazJ7vtOLkN41vFRPMqzbPyzk3AH06w+DwzkM0v1EkL29Cest m0WDRtqg==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1laC2r-00EsNH-Ve for linux-arm-kernel@lists.infradead.org; Sat, 24 Apr 2021 06:45:42 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 57D6261626; Sat, 24 Apr 2021 06:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619246733; bh=qoORv18jmoZdLwiy2XtjoLyEheeVP14AOEUNQBQWQJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ieDxBAbfFaxqZDSr+y9csJifDJsicJVEQJ0wjfRFLrBtUEf5xhPDf9t3dMZ+NzXzF J3jyIVhgdw5MLa//cBQu53DmuRneAdy2MrtXu8J3K0WnGtgv64BnxrKP/a8xJBEbH/ sjuXjAqOtuSFABLUYt1CiN+OUI9DQCTIGihSXsVlA2wwnybntBsDprsMv+XRAnl8mu STkF76aBxV2Bgturo3rIVJLeNT02rVnv8WP0fOkSrd94lZfiXAE+mbyS/sAiYL8OeA qNE21qdWvcfAUNU43NSoT7NIRFlTRz6HbYH5KchIj3O/NrfV87aqbvxXq09vnMh5E8 HeKxOL8gjn+cg== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2l-004Jep-Hm; Sat, 24 Apr 2021 08:45:31 +0200 From: Mauro Carvalho Chehab To: Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Mauro Carvalho Chehab , Maxime Ripard , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 23/78] media: sun8i_rotate: fix pm_runtime_get_sync() usage count Date: Sat, 24 Apr 2021 08:44:33 +0200 Message-Id: <4be9eda76abe0279438375abb0204bcf96aeb618.1619191723.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210423_234538_117612_F9D85955 X-CRM114-Status: GOOD ( 11.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The pm_runtime_get_sync() internally increments the dev->power.usage_count without decrementing it, even on errors. replace it by the new pm_runtime_resume_and_get(), introduced by: commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") in order to properly decrement the usage counter and avoid memory leaks. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c index 3f81dd17755c..fbcca59a0517 100644 --- a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c +++ b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c @@ -494,7 +494,7 @@ static int rotate_start_streaming(struct vb2_queue *vq, unsigned int count) struct device *dev = ctx->dev->dev; int ret; - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); if (ret < 0) { dev_err(dev, "Failed to enable module\n"); -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel