Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp671125pxy; Wed, 28 Apr 2021 11:42:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+QvIGRQ8KPiQWtwt1BpR5gkj1pPUaUj55ESrAsqd04+SSXoaHfa4oCF6aj4pjKihEYeTy X-Received: by 2002:a62:7790:0:b029:27d:3aea:83e5 with SMTP id s138-20020a6277900000b029027d3aea83e5mr3987659pfc.78.1619635323783; Wed, 28 Apr 2021 11:42:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619635323; cv=none; d=google.com; s=arc-20160816; b=wo0l/20aa0WkQR+EWIv/UWFKiuIgCpEuRBIdYbHhaqpAYFVyCRN2CUfgMK3TBRMwmT UpLDIBvz60dwdB9D6ffCILWC0cRQzsQCvG76gsirc4kNPAiI9ZFvqN1ELvNqmEFz6uw6 ykLcaEWZTxTGYdS+74jk/cgPEdVMGwsX4EW1qBYCqVlHxfOu7RJjuMUPlz/3NEOK4uSA hXecab26UveTW3iCYliAaZmnH+LCw7rsGV7D6IYyMnFTegoxXEpkPudsyoC1Uo9j4fah eeeKy7+0DUQzq6JXTCqXDkyhkeCyJXDKlwCw6EgaP09lqlxlFmqMdqD30V6VlUSuzght Er7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=u5PcMNolJ+Hbjx5TaiiRECAjrT7wB+0xPtci4EIZYbc=; b=QzqYDnG9utOQCAflaOr3iTlPSS+HT2xqHeTZ8gmGhbjqpyTpeXNlwz+w+Gu8wQ2br8 6g9DaSvZUHpHB3BzZBter6fK3hpXqPy+zZ0KYEXkIJiVAevyxvIogZ9ooRHjs67DMIAM ESK+8p7il1Cmq3TDQBhjKhh516y2iHbfzJXCfdFZKahb7Nn9oTQPosZ1D0DgjAxtbxfn /6/OuAFWzfAe+pJNPAcP4cPyNSV4bfNnR2TifjFJG54nCIidqjbyK8hSKtpm3NN6rHPk lYlvVzXd2rf8ZFDDG04j6L0cS9rrp+/3+/XPYi8lhatjjvruumE1EB85xVUBNIVKbtYH ZfAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=acFeyWG8; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ng6si560865pjb.85.2021.04.28.11.41.51; Wed, 28 Apr 2021 11:42:03 -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=fail header.i=@kernel.org header.s=k20201202 header.b=acFeyWG8; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240725AbhD1Ozf (ORCPT + 99 others); Wed, 28 Apr 2021 10:55:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:36740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240307AbhD1Oxe (ORCPT ); Wed, 28 Apr 2021 10:53:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3655361492; Wed, 28 Apr 2021 14:52:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619621564; bh=LvHrsFJn6JLbIexuKZaI+hIEIjqhrM13uG8Z/t+ytHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=acFeyWG85zM1TfdpyNY0FZBPG5b58t8Qda7XOXB/zjd1Di+P+E5Ci61lCLVsh36gs VtP1u3jvm640btrrknoGENeGr8LaSZ8tj/a1xr11u32LsCPQLhOQApFtrDzbrHvVSN 6zPh8Sq5pzvrAi1VUvgpQjkyzKLaq9D6jt9zmTG21Kfa8+CEl5bOckwJnkZjDxg2p4 mIhWMCa9AxkGFJkgugn+wmKTgU8bwBP+LRKdCXrlx7RochlM6Ek2V4dxKEsybL5Uri ZhaeqoGJqeZre6m/1ZcX+rG0WShzfbrFslKp1KyoVwML0IkC7RnNlfMGkPqySc/WOc 9YFoyADpXvUdw== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1lblYQ-001DqY-4f; Wed, 28 Apr 2021 16:52:42 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Ezequiel Garcia , Greg Kroah-Hartman , Mauro Carvalho Chehab , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org Subject: [PATCH v4 20/79] staging: media: rkvdec: fix pm_runtime_get_sync() usage count Date: Wed, 28 Apr 2021 16:51:41 +0200 Message-Id: <4bc46252a7c7ae3612da6da8620ef7db775e27ca.1619621413.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. Reviewed-by: Ezequiel Garcia Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/rkvdec/rkvdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c index d821661d30f3..8c17615f3a7a 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -658,7 +658,7 @@ static void rkvdec_device_run(void *priv) if (WARN_ON(!desc)) return; - ret = pm_runtime_get_sync(rkvdec->dev); + ret = pm_runtime_resume_and_get(rkvdec->dev); if (ret < 0) { rkvdec_job_finish_no_pm(ctx, VB2_BUF_STATE_ERROR); return; -- 2.30.2