Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9078460pxu; Mon, 28 Dec 2020 06:08:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+B/7Spl88pPRIkdpvoO1yHQlt5VfInQa/Uw8P+RQdOF1surqsMMEBsnog0ajiVtjEiPB6 X-Received: by 2002:a05:6402:13d1:: with SMTP id a17mr41943562edx.202.1609164481569; Mon, 28 Dec 2020 06:08:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609164481; cv=none; d=google.com; s=arc-20160816; b=F7d2Nz8yida+5jZFhYInukR+6UVsMPSjUTfT+YnnauJDw6ZXhNUsxK/7gVoYAsb3dT bn0ISEHZ7T+z2B5M+tCcs6nNGayw6xvY234JgY3MTx+fYh1oxdZcXLZjN1HSoK+mglhG 42ZyErGq0beUut4Y5Mb+vuYVNBhPpZys63Ndu9GQ3zAKLmeWGsMVR6F8JO+n+d0q4Zuo tu537ztjepYSFiwUzVT/HXKpBoiyYp8SwIrUwWy63nE38izZg5btcsb9s4U58mzWNdFR ks1Oap75oUq9FXbrnhWF8qXVhnI+kwC4vX/r3XtmDp8SrAPmi+bBKhAGYNbN5j7skl2I 7rNg== 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=XkOlcZ0Rvt2Au4OqVG34dW320DQFXnc/ZmqbKQUUJf8=; b=KLMTXHapSQzuZtlySyGvHaKU7bcUAGBC+MWo2EIIyIkc3IpgTOgEBtez9mnlg5BibH 8yFEcJHcVlg1AYYFBY9r+Lb80Mbf6dYRs7TTzCl3vY4KdfqbSRHjS/3CUpe0hQXbh7Xd syYaCUpHyyFNLUIeVMPvivUEebgFcfV061JRHSKkD8srf0onz7OuU00XYACFwRhOx5dM +iAwudEu+L8PQRkAl7Pv3Iorir0pC6d26bO5ZzCHN56/ocFh/3CABYZSTd/726KfEmc4 CaSVoLaH1iJFUEpfneIXbF9Y3ryTEYCzMyWH4iAKV2uyy+8C5oOdOWSQTzjXberC9bF8 s7MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AUAy7uK1; 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=pass (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 n23si18330301ejr.321.2020.12.28.06.07.37; Mon, 28 Dec 2020 06:08:01 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=AUAy7uK1; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437637AbgL1OF2 (ORCPT + 99 others); Mon, 28 Dec 2020 09:05:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:39690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437611AbgL1OFW (ORCPT ); Mon, 28 Dec 2020 09:05:22 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BE871207B2; Mon, 28 Dec 2020 14:04:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164282; bh=Z1rfFhuzp6IwUyMd17rCXrQ0YW7uMXwsp4Y31TjnXQo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AUAy7uK1d0Q4Rfy9tDeKWks0wBkw29sdIAb3Q6nmb4ex+Ti7v+W0Xd1yDTRL80Jqb xUNpzXC+jb2kVqN52H7waaS6rZPyMx1k3ZjnZOqBfGMJh/HLOkByTyWYzbbNCjn4Rk fGJicGXxjk/FVTfvo/akopoExcodHOVG2ogQ8SPE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Qilong , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.10 126/717] media: staging: rkisp1: cap: fix runtime PM imbalance on error Date: Mon, 28 Dec 2020 13:42:04 +0100 Message-Id: <20201228125026.986049733@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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: Zhang Qilong [ Upstream commit 4cbbe2aaa0536b0e7b3dfbd7febc3bc2ec300559 ] pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference imbalance in rkisp1_vb2_start_streaming, so we should fix it. Fixes: 56e3b29f9f6b2 ("media: staging: rkisp1: add streaming paths") Signed-off-by: Zhang Qilong Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/staging/media/rkisp1/rkisp1-capture.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/media/rkisp1/rkisp1-capture.c b/drivers/staging/media/rkisp1/rkisp1-capture.c index b6f497ce3e95c..0c934ca5adaa3 100644 --- a/drivers/staging/media/rkisp1/rkisp1-capture.c +++ b/drivers/staging/media/rkisp1/rkisp1-capture.c @@ -992,6 +992,7 @@ rkisp1_vb2_start_streaming(struct vb2_queue *queue, unsigned int count) ret = pm_runtime_get_sync(cap->rkisp1->dev); if (ret < 0) { + pm_runtime_put_noidle(cap->rkisp1->dev); dev_err(cap->rkisp1->dev, "power up failed %d\n", ret); goto err_destroy_dummy; } -- 2.27.0