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=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 24BEDC433DF for ; Sun, 18 Oct 2020 19:27:30 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 D290520791 for ; Sun, 18 Oct 2020 19:27:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oS9GXe9W"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="imBQjiFF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D290520791 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4tVKYq4M8F+xHUvSUPE6lnZM0k39XRofJ7jP4vgDM5k=; b=oS9GXe9W7Ns8BEmk3gGyYbwu4 tTqe0R1F+iHbWnhkIq9qcK4Zx2tLHAkx/sLgujZaqnpJHUydWEpsWUhWobAO3PT9QiDRJdV1znSOr rnoH/GCfnshrEdjkxcH3raB/yJkDU39RTCiiFBGMExfK4rJxp7BTunfTM2d6Coy/rqfi7TT22VlDk 3kNVFwY554JY+O4H1i1EbyuZFHnz5XDg6/cgIBU3glB9VXJZ4fzNpMcsqXpTC3Dg12FSX0CQ9Mm3E poj4iTjLqP9vaAz4DivvAHocKt1iXnX7ua1w5FAtwUiOVUrnwCyf5oq4lklj/OWGDf6wOOax8AQDd Oa9Us3cSQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUEJC-0001GX-F2; Sun, 18 Oct 2020 19:25:34 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUEIA-0000k7-RY for linux-arm-kernel@lists.infradead.org; Sun, 18 Oct 2020 19:24:35 +0000 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1B33E222EC; Sun, 18 Oct 2020 19:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603049070; bh=/l6hrO7GPupnXbyvP/nFnCmESAppWg17z8tPranVdBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=imBQjiFFR3TYa8Cldnez73iyeJv/w5q5z0/txCvqwxYUi0ysc/ZJkBVYbf9lWx8br Ax7DU2Vl5Hxgj30X7nWvPeWkd/y7Bdmutrxi6tTNgXBqnzcFiwYpDpc5NDfeAuW4zg TPzfTxZy3zvfbq9Ja3VEFn1ZI/a7qUOV/8/o70ZI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 09/56] media: exynos4-is: Fix a reference count leak Date: Sun, 18 Oct 2020 15:23:30 -0400 Message-Id: <20201018192417.4055228-9-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201018192417.4055228-1-sashal@kernel.org> References: <20201018192417.4055228-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201018_152431_065087_E84CDF05 X-CRM114-Status: GOOD ( 14.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , linux-samsung-soc@vger.kernel.org, Mauro Carvalho Chehab , Qiushi Wu , Hans Verkuil , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org 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 From: Qiushi Wu [ Upstream commit 64157b2cb1940449e7df2670e85781c690266588 ] pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code, causing incorrect ref count if pm_runtime_put_noidle() is not called in error handling paths. Thus call pm_runtime_put_noidle() if pm_runtime_get_sync() fails. Signed-off-by: Qiushi Wu Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/exynos4-is/mipi-csis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/exynos4-is/mipi-csis.c b/drivers/media/platform/exynos4-is/mipi-csis.c index b4e28a299e26e..efab3ebc67564 100644 --- a/drivers/media/platform/exynos4-is/mipi-csis.c +++ b/drivers/media/platform/exynos4-is/mipi-csis.c @@ -513,8 +513,10 @@ static int s5pcsis_s_stream(struct v4l2_subdev *sd, int enable) if (enable) { s5pcsis_clear_counters(state); ret = pm_runtime_get_sync(&state->pdev->dev); - if (ret && ret != 1) + if (ret && ret != 1) { + pm_runtime_put_noidle(&state->pdev->dev); return ret; + } } mutex_lock(&state->lock); -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel