Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp507567pxx; Wed, 28 Oct 2020 09:54:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymC9k1F4FpG0dn99LemcNaPNPHPpBX4hBJSi1oRV04FBVYJi3yHuZXj/+hA8e0C+jjffq8 X-Received: by 2002:a17:907:42a1:: with SMTP id nf1mr3526538ejb.135.1603904072217; Wed, 28 Oct 2020 09:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603904072; cv=none; d=google.com; s=arc-20160816; b=amqsD+bxsADIE8f6jns52cQWiievI6NLlHUuaU3V2REDgn0h4S0ilrR8hWYyfrCA3p CFQ9dCdC/Q3rL2IyBrh3WNrtckIJGYMOTko5Q9IDos+Fs7TzBBxnSEWJQzAAOHscs0p6 lagiG/UXuWvvgJEO2IJ19eqK3/rX8Au6wuHH7WRX++GT7xlwagleCY08vIJckWjTJCh5 WoS+mp0RASlQEPCDSTpB2lRVrpujCWfhY+vITf+nMG4DEkT+M9Uusgl59649cqW4/FNd hEwbbLN21l/acmScaEqs5kKmgSSq9qSww557M8C1RaM+zjHhK2hLqG1LEVgyPY5OycQ+ K4TQ== 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=cGeHz5+n5BYC806bdBkUkvyYagWLbt/PD56nfCQYnjs=; b=V1ALkyGxyZuuz7vLN9ZhWKdsAR/RijA4AdMqSBAQ58nptMUBUSnouQL/JVDiEBBJ2p YMpKOoH6EmZLh9Xozp+D6dHHP8A4uWr0cw9pyn5BTJ1+hnK3dz1M0MjbHcKKX75WGeoh v1R6Hyx8WEqU9RZlkxQEzxx9bMHTRTUHuZE5uuVixtTp5zYizFMD/GyZvwnjLSw1/UMm FHh8OQY9U9mSnPigAyus719y22TEU+nQ3dHVaDldH+VDCQMiIwF3X/+23CaPOhYoStl8 pP44fM4nS6bA0i5B56s6YeZ2bZ5e9n9Sb7uXn4BVcyUwweKeuCbt9INuYyWOxtVxbIht VOxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SLquMbRe; 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 i14si21419edl.282.2020.10.28.09.54.10; Wed, 28 Oct 2020 09:54:32 -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=SLquMbRe; 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 S369840AbgJ0RZu (ORCPT + 99 others); Tue, 27 Oct 2020 13:25:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:54092 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1780246AbgJ0Ox7 (ORCPT ); Tue, 27 Oct 2020 10:53:59 -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 F0CEA22283; Tue, 27 Oct 2020 14:53:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810439; bh=fJOQdd5r55z3eIIn2T7wkINZVqXnhYqgdJsYzGf8VVc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SLquMbRep2WFvv2ghCW4EWIbwa4RPeZjE2de0KU0k1UrV/kE7BAp+1d2ptqT7/SjC NDasumNZxMk6lAu16L3vuffgTZvFydINI0lj9c4/YPFs+bZ3/ZellKy875q/e9LwKv upFHlDTpymrP7uzdDQs3RgMv8eYzSiWEagRdqV1s= 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 138/633] media: rcar-vin: Fix a reference count leak. Date: Tue, 27 Oct 2020 14:48:01 +0100 Message-Id: <20201027135529.163664215@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 aaffa0126a111d65f4028c503c76192d4cc93277 ] pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus call pm_runtime_put_noidle() if pm_runtime_get_sync() fails. Fixes: 90dedce9bc54 ("media: rcar-vin: add function to manipulate Gen3 chsel value") 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-vin/rcar-dma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c index 1a30cd0363711..95bc9e0e87926 100644 --- a/drivers/media/platform/rcar-vin/rcar-dma.c +++ b/drivers/media/platform/rcar-vin/rcar-dma.c @@ -1392,8 +1392,10 @@ int rvin_set_channel_routing(struct rvin_dev *vin, u8 chsel) int ret; ret = pm_runtime_get_sync(vin->dev); - if (ret < 0) + if (ret < 0) { + pm_runtime_put_noidle(vin->dev); return ret; + } /* Make register writes take effect immediately. */ vnmc = rvin_read(vin, VNMC_REG); -- 2.25.1