Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp176177pxx; Wed, 28 Oct 2020 01:40:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrtKnyP+N6fE5tauBRr1n9eqGS39+6ikwz1v5GZKi0rqElFL+EHhG3mNrh860FGB9+iCiM X-Received: by 2002:a17:906:4d4f:: with SMTP id b15mr6394745ejv.356.1603874456020; Wed, 28 Oct 2020 01:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603874456; cv=none; d=google.com; s=arc-20160816; b=XiENf/BZ6V5PpRTsKgqR0jHuUdanWXSG5M1VEY+akbCmkwpN1iSVuZ6gIqlBVOWdnp lMwfuyK0iSXgkqvDLkJyZYfM0j9+CjAJajX9SXy8MxhETnXH5FiwhqysXyg749Om9yEs urfhLn4s7U7QN5b6bOpDA1bmVj3hAppUTy3NaGleqoEFOu3V+s6/ox9XPZpfylUQw/AL fcrb8e8h9CVaSpsRHHf/2FBKS3lyZ9KyN6l+tVcQZ6Pw/ynxC0WjgXGYvNvD09gmSu9Z K2rVKPtiuW3JL+Rc+5YxGHk21XxZRkUV/trLG9xkNt2J1//3Z2BHWNWqAuyb38kVGpjy Ljdg== 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=y98x3Cm/s/iUj7utX1CdDayWj6EC6z+Tolh8aq4Y5BI=; b=KsiL/2ACycfBCeasZ2y3UzU9HRUz86E3ffbhjLDudT4LZH7uVQD4I+rg1IMbo6SwUi iXeWvcpqnQeLtVEHyXisvteIG1yNLGEs6YtCY1L+G+BubTThf+K2IJPngXpTIZh+FK3I rjlvqB53TrnYyPsUKZi6GiYg9Ub8GlQib1qwhjGfHHftXI5+gQCin/9Kv80nICmUF+nP CBB87jP96UUDeNMcZJw2pnktRT7uay7pV2Utt0Au9rjJmHtbeqToEPagzYAXPoVOuNyl Mg4SmL+WFPQuDI8I5vJbYnByolNpyMnB1UPkFeSeC8hfHGly84n1HIqzgVVzr409RpEu QrEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yVbY+X0C; 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 gf17si2900638ejb.226.2020.10.28.01.40.34; Wed, 28 Oct 2020 01:40:56 -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=yVbY+X0C; 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 S1754978AbgJ0OH4 (ORCPT + 99 others); Tue, 27 Oct 2020 10:07:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:56480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754909AbgJ0OHj (ORCPT ); Tue, 27 Oct 2020 10:07:39 -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 F19B22072D; Tue, 27 Oct 2020 14:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807658; bh=5uoHFF2A2jlM1VPWPJgzLbjYCdlZhhicwnt+SDr7LNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yVbY+X0CjYaV7nELmUCXBdMhrynBULzO15CzN366l6S3qacFG50kPU86yN/dRrkE9 u5WuuMXqy603hpBvLXM0Q2S4x9thPNFO0Luk9WbMJkuQJaNQFCcwsXk7XN7vDSoIW/ iFZtuMcykZ7s5rUGl/37FAT5IKyp+TFsfY1EqBbM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Fabien Dessenne , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.9 103/139] media: bdisp: Fix runtime PM imbalance on error Date: Tue, 27 Oct 2020 14:49:57 +0100 Message-Id: <20201027134907.028790064@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134902.130312227@linuxfoundation.org> References: <20201027134902.130312227@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: Dinghao Liu [ Upstream commit dbd2f2dc025f9be8ae063e4f270099677238f620 ] pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Reviewed-by: Fabien Dessenne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c index d88c9ba401b5d..bec4278401b2a 100644 --- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c +++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c @@ -1366,7 +1366,7 @@ static int bdisp_probe(struct platform_device *pdev) ret = pm_runtime_get_sync(dev); if (ret < 0) { dev_err(dev, "failed to set PM\n"); - goto err_dbg; + goto err_pm; } /* Filters */ @@ -1394,7 +1394,6 @@ static int bdisp_probe(struct platform_device *pdev) bdisp_hw_free_filters(bdisp->dev); err_pm: pm_runtime_put(dev); -err_dbg: bdisp_debugfs_remove(bdisp); err_v4l2: v4l2_device_unregister(&bdisp->v4l2_dev); -- 2.25.1