Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp533891pxx; Wed, 28 Oct 2020 10:28:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbWZMQ3s3zTamJqiNGmAl3ouRCkAh2/zAZOW43/mDgwtH0aY1+tHGWSkAfV0kl9CcHUXrE X-Received: by 2002:a17:906:2cc5:: with SMTP id r5mr155249ejr.328.1603906137941; Wed, 28 Oct 2020 10:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603906137; cv=none; d=google.com; s=arc-20160816; b=E0R//60DBLaIo9w7aU1JsKWT+06FNknFLzwDRsMx42xE5KAD8CUXhA8bsknLAqQjV/ 7FnWlwVlrfLy88HLcwoHQcL74W3hnFcfvAQlG/P6Uwjy++yBEmDjg75ESUpxHHonpajI eOhMr9ZyKaupvFNZUoRKczT44jOOU5Pt8lyTxNCihM4xd8MUiHs2akJWfSRg0NdwRlbP yYqb6h0kJty8YPB2BckjBZ7p9MGORDpBIcwCntkYxDEezf2P3kpLOPCbHhtBiy9iao40 mkyGulj1HlTOgEDcy6+w+h/5dqeAaMpiIkprXmJQUSHy8QCjBRYhqLRnEyI4j/TSiga+ AJrQ== 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=37YCl7DlfPmpgyG3V6PCpgHG6CjDfKpDJHWu9H/NHZs=; b=IA4zTL1Wd3I0JpCuOQkCuUl3nCT/IkuyuMLHE9uas5W7sPcfGCGPscwvfjgNHxgRYB sYOaLawqSAcKfY/ck1tw8imoAkgqeY1+sRc8t6n6D1Secr3EXeZIcJ7KeATvCuPuy2z7 5VXwU/z0V8V4QMK0zQqtNqxSqjonHj/Y4YvMNwdc3SMrkeXtMEWR2MFPsltG80ecdogc 30U9tzBLeFyNjFitbQZ8rcWW5XGEbYlncu7sk5e8eO5LbiCrD3xECO8xEuPTtWvAoNao DLe/QQ9hLppfejglqyrgcynOIWQ5vG/4vV6GAXBwZl8ctBh1SYmldDzwumDNc+Mnj0lI CS7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uvoqwKUk; 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 gb38si1650347ejc.555.2020.10.28.10.28.34; Wed, 28 Oct 2020 10:28:57 -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=uvoqwKUk; 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 S1821331AbgJ0Rml (ORCPT + 99 others); Tue, 27 Oct 2020 13:42:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:59256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760090AbgJ0OcW (ORCPT ); Tue, 27 Oct 2020 10:32:22 -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 2619420754; Tue, 27 Oct 2020 14:32:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809141; bh=BVxlaQ4e428YxoBkIKi4lxRZtgM/8yVnXxfe50osDKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uvoqwKUkui0xiBZ7gUfcjXOG4ifpZ6bk6axoM3pGjTOyrimRb1o5JzkAEpet7rVfl p+jTOfrPkLmeMFPcRjQu50NpfVlAXgogSve8VffmUJi//zN6C6mkvuNFs+FOC3r88F SJMxuMarfLEUgv/U59QjpmgPXDBghfrKOACcabyg= 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 091/408] media: rcar-vin: Fix a reference count leak. Date: Tue, 27 Oct 2020 14:50:29 +0100 Message-Id: <20201027135459.308237140@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 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 3cb29b2e0b2b1..e5f6360801082 100644 --- a/drivers/media/platform/rcar-vin/rcar-dma.c +++ b/drivers/media/platform/rcar-vin/rcar-dma.c @@ -1334,8 +1334,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