Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp507172pxx; Wed, 28 Oct 2020 09:53:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxm5kOzYbeEbCPg9VH0lDzVlPF4g+N2wbCAB96C+NLpiUA0528aeY/aXvJhOAotdeFUJPrp X-Received: by 2002:a17:906:c451:: with SMTP id ck17mr8339014ejb.303.1603904037540; Wed, 28 Oct 2020 09:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603904037; cv=none; d=google.com; s=arc-20160816; b=khl9A1IpjZfgPRReRiLcPWjiHswVb0aLlQCvjUgJD3W8QjCrpQnH9SEgeRHNOcpThG oaurqUDZnuKoZA0A07m6uOdkeZ/SEZ4fqocFf2FG6m150VqvuNO2/4TmBj/BCnP6jHCr pb638sgbVtZ+d5/8BIDjDQ3a1LRyaY8Ih0tK3kOIQwVoplLgDivirxAVoi7gojS3vm1a +kQTggELfFanzOHVMTPVTToHYHJhu+UxwFYRWErvxCo6lUzanL/ntyWplqVdg1HigusT 53qpYhJiJmYUQF3zcEIwmetC3+B1vlLw8c5zlQCCtcsBy4x5y0kRqz2OPsXcO4pIBjVx v96A== 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=FEENOgygqjVLgvWswM/kitWQko8ZB0lW/GHBZ3ZrKyQ=; b=gKeMyJIi+I19nuEUAVQoMUHURUfuM1vY0RRX6KTnpY+p1Zsa3rwvcoC7rvi8QA7nHB CMDpUefu86cUP+hSRN1xfRbP7eec9A1WtFezBR/tsUG3dkSp2NEj6uwQY2WVe3vUsCoh ywFNZe6//ZHZfCGaetOzKWWQPvFtn+ikHnvkcJg5M0WkmHjO3PyVwcCcYALszG+C2zhd tTqeNIR2R5W7rr0tz36B8JcTdRu7hO1shUWldbXcNSRjrMYmIDnWksSlfEbDAnTR5Ozg tbP5yoW73VsOcanIxjoLLS8dqymOLSeskFR6065yB4shLdifcAmnbo3xCjKr+7cSl/6l U+eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="JKySdt6/"; 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 h20si3592583eja.402.2020.10.28.09.53.35; Wed, 28 Oct 2020 09:53: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="JKySdt6/"; 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 S1818898AbgJ0RYr (ORCPT + 99 others); Tue, 27 Oct 2020 13:24:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:54480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1780274AbgJ0OyC (ORCPT ); Tue, 27 Oct 2020 10:54:02 -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 B5AFA222C8; Tue, 27 Oct 2020 14:54:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810442; bh=Bj9nvGy6FJH0Uaemm+kHcT+1DfewkYSeGOYxNRewNQo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JKySdt6/Gm25O9ZtYnpG2/VRA7U6sTgQUDRxyuWtTx3T5ZM6zE40OoQy1c7pGyEkk diyB5RZuCD91lHv8HY9F/IpSLmAudvovK298F9YV8D/RI2/GrbRvA6PKiQJAQId69q kX4i6mG5KOmt9dX0V8kebqtoK/asEvyzUTaZsC/o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qiushi Wu , Heiko Stuebner , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.8 139/633] media: rockchip/rga: Fix a reference count leak. Date: Tue, 27 Oct 2020 14:48:02 +0100 Message-Id: <20201027135529.206075347@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 884d638e0853c4b5f01eb6d048fc3b6239012404 ] 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: f7e7b48e6d79 ("[media] rockchip/rga: v4l2 m2m support") Signed-off-by: Qiushi Wu Reviewed-by: Heiko Stuebner Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/rockchip/rga/rga-buf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/platform/rockchip/rga/rga-buf.c b/drivers/media/platform/rockchip/rga/rga-buf.c index 36b821ccc1dba..bf9a75b75083b 100644 --- a/drivers/media/platform/rockchip/rga/rga-buf.c +++ b/drivers/media/platform/rockchip/rga/rga-buf.c @@ -81,6 +81,7 @@ static int rga_buf_start_streaming(struct vb2_queue *q, unsigned int count) ret = pm_runtime_get_sync(rga->dev); if (ret < 0) { + pm_runtime_put_noidle(rga->dev); rga_buf_return_buffers(q, VB2_BUF_STATE_QUEUED); return ret; } -- 2.25.1