Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp534195pxx; Wed, 28 Oct 2020 10:29:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4XPCN9erwiBjwQzYpKl5OZKI2R//P2htdsS83FF1B5wiAi0o2mKU7u9c7zJX31Ee4OsHx X-Received: by 2002:a17:906:3413:: with SMTP id c19mr95861ejb.421.1603906167730; Wed, 28 Oct 2020 10:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603906167; cv=none; d=google.com; s=arc-20160816; b=ACFoQHWrQoOzS89EiARo70o43v47T1gvtF4dAPWQ0TqDOyGTFfeKOj7+imnhvTC5W3 nEEs9BxWojRAdz/L2WiklaSZ6HpcbnQ3pXKolJQhLq7IzFPnpPandnEEUnqM3xuENgFq 8Oz9Uj9R1Vb/6e6HGpmsKBIoXtGFUoC9b+jOBtMixF/7XPG1A4bQ2sYHGhQxppFjUsJw vR/jpenwmVxuFKRmdxGiExIoK2fREs3MZhOYqgMRO2LNwl1VRNPUbQ5KvBZtOeMYBWi5 O0oHO0kBHEpwB75qCesLQFMg/lo7yOKSaUEw62IRQp9pMhOWGN0G63f/UE8bCAg28pF1 vNog== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WheTUIP/SbNDHV1FIr1naQC6hYohGrVcqOf2AEPYD38=; b=WbvA9MOm4EqvTSedO0Pker7n4H4Nnq2z5HFqcTyDuS2oMiAADjW//qJqsx57WDVbTA /2zU5QEl0OsWUfUzsHydj3cIf17NZnSNyBrh66KLuNuoAdfdKwFlJGzaAJlk1quWMSET L/DEOOcmM+EM9+DSHx8mOGQgrDABMCMpLrBxaY71V5mpAVEW17Dje+jZY6+BDVgOG4zd PVAZygae8MdGkAHBxmi3Lq/Ic8iik7ZeHVDpkAzlXesrIbzhPaT6MpMqGL2z0fwwsMxd RZbyfDffyg2dm9VeXkLXOZ36eOUyDKxqKq/6W77lH68/+2xE3mpE7jHltjMYW361nJPg e+kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hTs+sObr; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d23si26051edr.183.2020.10.28.10.29.05; Wed, 28 Oct 2020 10:29:27 -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=default header.b=hTs+sObr; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1821316AbgJ0Rmf (ORCPT + 99 others); Tue, 27 Oct 2020 13:42:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:59378 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760106AbgJ0Oc1 (ORCPT ); Tue, 27 Oct 2020 10:32:27 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 75A3220719; Tue, 27 Oct 2020 14:32:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809147; bh=AevS3VJiIWV6RWC+KJ2jiUeCQrep6DzQMeOmMC+G+wo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hTs+sObrMpjge4MrUnGH68Hh+OMJZ/oa5D9Mi/hw9IjX1zapxsTEoijujkLoTW+YD rOCQQEXobgk49pa+JyB5CHaRH8Ar0EDCG2EER14Lk7Phty1TfXsrkKIEd92d5FHCUl toDHbXCjz772EZO4Bs5Lx6e0SsgK1Ny6hvWQo6VY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qiushi Wu , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.4 093/408] media: platform: fcp: Fix a reference count leak. Date: Tue, 27 Oct 2020 14:50:31 +0100 Message-Id: <20201027135459.401993094@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qiushi Wu [ Upstream commit 63e36a381d92a9cded97e90d481ee22566557dd1 ] 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. Fixes: 6eaafbdb668b ("[media] v4l: rcar-fcp: Keep the coding style consistent") Signed-off-by: Qiushi Wu Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/rcar-fcp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/rcar-fcp.c b/drivers/media/platform/rcar-fcp.c index 5c6b00737fe75..05c712e00a2a7 100644 --- a/drivers/media/platform/rcar-fcp.c +++ b/drivers/media/platform/rcar-fcp.c @@ -103,8 +103,10 @@ int rcar_fcp_enable(struct rcar_fcp_device *fcp) return 0; ret = pm_runtime_get_sync(fcp->dev); - if (ret < 0) + if (ret < 0) { + pm_runtime_put_noidle(fcp->dev); return ret; + } return 0; } -- 2.25.1