Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3343636pxv; Sun, 4 Jul 2021 16:05:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymgKlDKnfp8yAPgHvY8hQYGM20DtJVSjRXZwJ0BsXAg9zlRmGo851xFLC7CfjBtjTdEKPA X-Received: by 2002:a02:c906:: with SMTP id t6mr9770412jao.117.1625439949292; Sun, 04 Jul 2021 16:05:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625439949; cv=none; d=google.com; s=arc-20160816; b=eC1CMlODSrFduLTjYNWllBeg9USnGqggVAXMxoS2jNkaDKtTnqx9+nV0Y0zIbMhRxc mO0kwmlmejqhzYDz66ycfDxgZEp9f1WW4/pEejsjuIsj9L33Lq0Hf6K4Axp90TcgctKy WKFKXtGuIBlgv+V3qYL2C08NasDFF30uoIbck5ZLewtiyM8LUtErVJzR8nHfi+rAQs/f nZdUal5gWWa40A+cBMDp8BuKMpd+Oa51Yp2L2bra67B8dcsLW4nH+vMo+oHtq4lrmiVk yiqx47Ld9gKdEMh7KHZTiM7+0nNWdkKzPHgKmfr4lEHRKznUWgM++ByBBNFcsoznz1DO 3U7g== 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=H6DutvkTmth9lR+OmWj9rRJ2sr8t8cJ75UfSttZWdSg=; b=ocAaTbUoTaq4SaGovUX28FlYfQcxXKLScXIN2Ey6tBrlf3D99P8ojGWTTl00g7mU8l oBNgc1NWdLXWf3mWB3ptkbZw0I8GjYIh5Fa05j6debYzAY9cUVzRZV7n4Bd5dcfzisQq SA7a2MCSQ6l/EefJYoScFoqfk7qcI+fBJwqEPq2tg2RtMy5yx6g88xTywdmRk+twr15R 4bD+pCVyBPKG2raTDCcZOXRmQ7j9xXfmc7taBVODD8YK1oaFoCAYnOWn9WR9/mDlWo9R yebufRqdj8maDy+TlRYsl/FXU1gFWyn1FtZH3sQ0PwzowrGLf4mG7wQxfRj+1SEYOxl6 lJQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CRQc3VBO; 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 b6si1342050ilv.22.2021.07.04.16.05.37; Sun, 04 Jul 2021 16:05:49 -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=CRQc3VBO; 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 S230098AbhGDXHU (ORCPT + 99 others); Sun, 4 Jul 2021 19:07:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:45232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230001AbhGDXHN (ORCPT ); Sun, 4 Jul 2021 19:07:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9C57961283; Sun, 4 Jul 2021 23:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625439877; bh=VvBNWVfKMUPM1hXDvZqcj89kC+byaY2wtn0l6MzVFvM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CRQc3VBO6+e3uKNkyTt4PT9iiC3oIAbjOguQWlYPtlIWWbYskQIkQdNnmKD71LGHh Z/ojjSu2DANP7IYcOX9WlixMbj1aCWwQZnprpNgxxlVed3Ix0a2vSc9QRP1w0rRIKz 8GUOKm3jBKYjFY/XesCuvoDl7/oAR+G97bnbTHLFsQwGMpPWE5as5gljakmYG7XpI4 v1JS3wo6aHIZuvOxyaVts2dmsWngkGc3DJ34kwkzZhKLJ8mXejre4zOYzL+jw6tAZn GhXo/tZ4zororHS6Z1+pG00V/VmvZnHcTJFpFU6+hW17sfLZLr6AXR+X7cfxxwOjFp cvhmYZ1M0h+IA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mauro Carvalho Chehab , Jonathan Cameron , Sasha Levin , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH AUTOSEL 5.13 12/85] media: sunxi: fix pm_runtime_get_sync() usage count Date: Sun, 4 Jul 2021 19:03:07 -0400 Message-Id: <20210704230420.1488358-12-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 9c298f82d8392f799a0595f50076afa1d91e9092 ] 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: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- 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