Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3343340pxv; Sun, 4 Jul 2021 16:05:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtMhmTU6HXHbXzVNLMGLs1U3jgPgVfQu3NvIxYrxveUoNeIm84d/a2eqjYhC0eaYqlRwbM X-Received: by 2002:a6b:f41a:: with SMTP id i26mr9391205iog.162.1625439912661; Sun, 04 Jul 2021 16:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625439912; cv=none; d=google.com; s=arc-20160816; b=xZSaZ0T8aINFWsZ++lk38uaMN/76zMDNGEVBXgRIcy97GROIa7pUcy9SIK4GlS/fMR 1BCHtEQHGxSopCRHaL90w84enxeoKWikt4Wb+5fS9kcl6C0m+hVtOUYKCZ6qN/1bt//4 lOd6Z8cT8/TWsFCUFyUtBIYoYGPEX6LOLSBidHfr0gH24qjBazhzy7jkMRczTThHNIAm 7q95vwPW/6nKUplyG/dJHNN0wifDYksXBFtE0jwc963AKDj64x+4Qjji28Ouh8P+2sni hnBsfT1v5GeajYPWx/gREHGhLbtVaz1/HB1jWPb4yJFkyuwcaheY6rwBGfGegX6w0nnm rGLg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4H1tsoBtlnpok8y5ZmsMAbF1e0c8dRoBafNt8lJLPu4=; b=jVDIUBxZU71NqgpSKdnoKflSRG/vydVHCIGy9gMhAwqm4dZKOlDuLGtnI/DGb706E4 56YoJPe/vnotkxsly3T3fcBdRro4CF7k7OaDCAbGqzhe0QcoHqpm5SdmW0UvDL/TIpcC 8OZnpnMdV05WR9NkEBrCHgEREqZpvqKK078cIX1TqOihZcbhhOTXCu8d8DKPx6LhQPwm zM75bWd/GlGW3JCm2SsQAtZstADvT5bwpDz0is9cA3O6q6kEUZLRxLKByeocS69KmnaX 3a7df/j+uvazP4yTVDe4h2WzLmpAG0jacT7+ruK7Uwwk0HdfBB71lV/Y35z5ND1wczaa 347g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LGHZa8bP; 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 h4si3291693ilq.151.2021.07.04.16.05.00; Sun, 04 Jul 2021 16:05:12 -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=pass header.i=@kernel.org header.s=k20201202 header.b=LGHZa8bP; 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 S229809AbhGDXHD (ORCPT + 99 others); Sun, 4 Jul 2021 19:07:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:44848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbhGDXHB (ORCPT ); Sun, 4 Jul 2021 19:07:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CBC0D611ED; Sun, 4 Jul 2021 23:04:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625439865; bh=HZKz708QQAe/6KtyqJ8F5LJ5x4ZN6OM3xsa305vbhbM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LGHZa8bPLqZiNLsIxNIXKndxpcwR2kDs+F2W0hvoFnhoXmAYp9IOOVs7/wouRxcze XQX5HntVzAECi0jFkcDATtV+AQNTrWuhhDgKsiJ+RZFhQXIwRoQ8Ktyi45a9ijJa5o H43+j00KUk1gqQcyVc57oLVapzMTx7oEDwAQGk4VTRJMUmTROvkh2Mbi1iIZ222B/I 61pEKzkqHfT8HAKpwt95S+ez+sFrvUUl5GDyfQakUbcU6ruLTKQnS4qK6YGWwd9GP5 hLb1WMn8fOIniUx5mMlar/UvuQcnkf2LoENgo9j/UGTX855B7gcatsvaDXyrqKLX+G mcrT5S6qCrIMw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mauro Carvalho Chehab , Ezequiel Garcia , Jonathan Cameron , Sasha Levin , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev Subject: [PATCH AUTOSEL 5.13 03/85] staging: media: rkvdec: fix pm_runtime_get_sync() usage count Date: Sun, 4 Jul 2021 19:02:58 -0400 Message-Id: <20210704230420.1488358-3-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210704230420.1488358-1-sashal@kernel.org> References: <20210704230420.1488358-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mauro Carvalho Chehab [ Upstream commit e90812c47b958407b54d05780dc483fdc1b57a93 ] 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, avoiding a potential PM usage counter leak. Reviewed-by: Ezequiel Garcia Reviewed-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- 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