Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3345916pxv; Sun, 4 Jul 2021 16:10:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxC3yDqMggrWughvn8qDZf2xfJa7g6n/ttGnw/L36y1sUIaeOdZBUF4v5WeU1maBMa8WnMl X-Received: by 2002:a02:606d:: with SMTP id d45mr9852781jaf.86.1625440205923; Sun, 04 Jul 2021 16:10:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625440205; cv=none; d=google.com; s=arc-20160816; b=u8D5B21n98uFJBLJjQvRawQT1i/bobS6aF7T6SrIPDDoO2mZe2Uwq4Ad5D6AJI5RAo iC3l0wp/kI8uolGpekty8refUyELXnQGu44A4VO6ew6mN1F4UC4FKGCB1zCdygZF1NGv /Vt+O7EypQHL868JvFK1jTw2JI+ZBiDrHnlMDVc/GD6q4eBMbCUad81px43oXBu6jygv DmDDDqmH6ZG1hLKY3kIhGrO6RY+ssgFOm+hyz5pGoe1zB9OBR4d61QOdWR5N9g1Bwhg7 NO7g4vgevyeVkucNxpiMOdm645jm8ZeVubQ+lkKm9EhZOw9eiqqyqZIPuI09/dRAZi52 reRA== 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=OBArfLUqKtiVvixRgrWgBqXzr1uRZXVKIeTgMS2NYCg1esaja7nCU5F9jMAAdHtdwM 9u+HGCQfsVROfSDiujw1/1OzipuzMEvtQL2BK1/Vdtkw3CdMIcIUHa04KDECnOY8d93h oddUZtUB17i6hv/AizTLiA2BM2vANh/7EH/6MPQHLOttpZ/mMWtvrpWny45awho5uk5F ymf9NXGJLwKFPLQYUGi6QaiRhhb+qYXnTWj3lFSeJsFCosY43qFwsKwhBuKzsQl/yLjS 2Jh2mahAOdbBI7hMWTHsuf1rnfOe9mCHA1JvaOW1sBZGYHIz+X1BuAE63NIXY2+jq8pj QwuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VXaJa0qu; 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 u12si12259600ior.23.2021.07.04.16.09.54; Sun, 04 Jul 2021 16:10:05 -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=VXaJa0qu; 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 S232180AbhGDXKE (ORCPT + 99 others); Sun, 4 Jul 2021 19:10:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:47610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231587AbhGDXJA (ORCPT ); Sun, 4 Jul 2021 19:09:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 493906141C; Sun, 4 Jul 2021 23:06:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625439981; bh=HZKz708QQAe/6KtyqJ8F5LJ5x4ZN6OM3xsa305vbhbM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VXaJa0quEppcPLV8gjwJ0TdZeGnEa1SAOe0VTL5jegs5IA4NaIYpRiAmLlmSxN4gB a/CNhcBN55+bhOsfFAr8MDlCSKI+/f9irbOEbTv/d00jQRVOH8qyUpFdKDJPJ3fKyU mL63gTiTxL1oOna0BWvj6kBfkWjppmh5Nhd9wfJWUnI1Fa5JrgcPzCTiNFOXkg4rdl Ro05M8Aot0I/FkyTdBz1WDswhwnrS3gsqPzk9ckgzZRdm7gnTZauHK4rTz+kGjQs/3 bOF1wUAGDme4W6IKf5Oy/2Le9GbhondJjsHvheLoE5GUeNP7sKl+FZB32NBKv8zD33 bqAPFPtNPWJ4w== 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.12 03/80] staging: media: rkvdec: fix pm_runtime_get_sync() usage count Date: Sun, 4 Jul 2021 19:04:59 -0400 Message-Id: <20210704230616.1489200-3-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210704230616.1489200-1-sashal@kernel.org> References: <20210704230616.1489200-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