Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp506905pxx; Wed, 28 Oct 2020 09:53:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwE/UIaFy6/LFICIT6I0WrF5zBPHaFCyKmUHKBedC5H5vcR8qVAWnhyly1wrPUI7zNsr9Wc X-Received: by 2002:a17:906:d86:: with SMTP id m6mr8001501eji.331.1603904017465; Wed, 28 Oct 2020 09:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603904017; cv=none; d=google.com; s=arc-20160816; b=IDnxgfwjdbVzHYCOw+sIj7AWYBXBzLA4YmsF0l2Iix5QkXMy7GAGoldaK8ZNnBkUgs XwqQRIw6V+c3OyaGQOn54qRo+a0CSOTSq9siQv5QvLIJnON3up3HchZJQND3XvrCCMTL pbqj1EOhzF+M670++oNXYFyUMK113sr/th+U+8yK0VVLq2rCFbEVQKoS9fdbWsts8dn4 46qNJfkl4PvusS4NYzDM6dy2fwLnpWN4XHh12/5dF5c4sTVdj9wVXZAldZLU56dQ6cNG ZyZr+CSuVehPXwcZC199vOGK9rjNx0InoVVtawHTHc6wprZzW12VzaFZT8+OpzNWPmHz c7Jg== 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=Neqhs05ti8mL0ilkSuT6BHEjKRj57JVeQEdDP3FzdC5gjvcI2BrjSrVsO2mYCwtHqN JMoR52bZvqDrK94szYPGNMFc9uN4vitaFUR1Pe50OxWJyCpfd77bocMQQoUuu5ikrggo fSvJW233NSucEdQpqPHy0ROust8T8LO7e4DljuN0xVafgNF5S48Ty0oE24x8WVDmlug6 /h2wrcSQhsdRPoDAHX0oDnTjHCHyRxF+OkfWSLQvh+jOmg6SdgPskkV9kVj5fYkngZH6 IH3PQ7ambcoNNHj9E0ISho4mqsLU6MzqwOExgchibdVTaB4RIsZFOusYJjlCMQsfxZLL IWMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=amnSl5ch; 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 e13si3955588ejq.552.2020.10.28.09.53.15; Wed, 28 Oct 2020 09:53:37 -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=amnSl5ch; 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 S1818885AbgJ0RYl (ORCPT + 99 others); Tue, 27 Oct 2020 13:24:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:54506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2900782AbgJ0OyF (ORCPT ); Tue, 27 Oct 2020 10:54:05 -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 7F48222281; Tue, 27 Oct 2020 14:54:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810445; bh=AevS3VJiIWV6RWC+KJ2jiUeCQrep6DzQMeOmMC+G+wo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=amnSl5chxmm5bGkqVx6a63YxC/zY05WJF4aC/lZCQ+pEmbkK7uwcJbAO6kqf/FLnG WcnE8g+V7l9J38oUS04cYnj4qD5FPPl5yu3RApsrCh8fAqg/NKnDm6PoJQo5t5YcDO F2a3tzHo25nq4sZ+Qt8WPC5sMU5e9eMLimIv/qzc= 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.8 140/633] media: platform: fcp: Fix a reference count leak. Date: Tue, 27 Oct 2020 14:48:03 +0100 Message-Id: <20201027135529.252887752@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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