Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp164748pxx; Wed, 28 Oct 2020 01:17:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvtozjU1U7ru8s4fgflScQqDiGE3F04FpyCqspddMmNVbMKefy6sLf5viUP4c0qnVNpMoG X-Received: by 2002:a50:cf45:: with SMTP id d5mr6328344edk.225.1603873033216; Wed, 28 Oct 2020 01:17:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603873033; cv=none; d=google.com; s=arc-20160816; b=RBjUhypKUyKUqCOQwJx7LXs2suOZoVvJvHatVj4sSEEapGdiPXIhK8+bf1MCGFFz7W XVKmsmadi6e/Th7s+fNxxtM0yJCRs2QoDd4P6P88WPPmIQqBGkQeBuBUmCJh9T5CU0OT EUtW7sZAbbMc9T1yWMKmVnvM+z24MWiae83yfAUpg5RPk2NBKw+/w4cmGHHSmSaL/W5d WF4aJDuA6W2tMuYhPIeiC+s8fdUby1XFnWXpnfskg29wAdPs9pNEYXDYMwI601G0nJhJ EnYcTjc/ceux15EVvn45p0jMZIqFqJRco4anjZmdp4om7FlihRrISWfoyfpqotwYxBFX k4Nw== 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=z9QnLrabIheP/EHW2yHYirM8Cj3QhSs4ruqwhud6RfM=; b=QQvef3Xh5Xre1LxUNZexzge7R+99ls8yEa5aEjw+ux5Q73LmL8cICYirKWjZmHO8fY a3BfCUqoM4d5Z7mnKdO9vwgX3LRa2SviaYZiFzxI6x1slZ9InCazsMltnWnHGHB/NWDE 6tlxfU5dtF3o1WrWlJL9qOnour53GR+cf+NB4M9jdVNbzoPzxRzov+zVbYuM7KQUfrjm JXKDa3zhL+IbjP37lld7yFhSpec1XVjn0ObSdhN9vuEQW6U01WyUOmcVFr7o4mco65d1 kknAcXPd+7GxA4+KMszNTZ11/ERQmZCu0kxM/LbyOBcAPqVkOzXlBS0/GgqgSgKBT7HF zhZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=a8+lt9pl; 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 a42si3838927edf.535.2020.10.28.01.16.50; Wed, 28 Oct 2020 01:17:13 -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=a8+lt9pl; 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 S1753643AbgJ0OBP (ORCPT + 99 others); Tue, 27 Oct 2020 10:01:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:47626 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753566AbgJ0OAJ (ORCPT ); Tue, 27 Oct 2020 10:00:09 -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 BABC3218AC; Tue, 27 Oct 2020 14:00:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807209; bh=Etl385WUN4icE6iEWAybHyDVoUUE8rGg7lanvGlSY/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a8+lt9plqVddAV8sijT0t/G1S7WgmYgPTKKOdSMkhjooCgbkCvwVhNyZtwj7b0CRm S24pF1dpuet5RguCIR4xupnmq8jPftnuunviWk5XmJUk6yPyt2NCVS34AiEo/HDTbn JZYgij+1t3sNWNf/7FkRbiJljISv8iRH9jZDT9h8= 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.4 082/112] media: bdisp: Fix runtime PM imbalance on error Date: Tue, 27 Oct 2020 14:49:52 +0100 Message-Id: <20201027134904.424750125@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134900.532249571@linuxfoundation.org> References: <20201027134900.532249571@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 a00dfaa1b945d..6c97063cb3b3f 100644 --- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c +++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c @@ -1369,7 +1369,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; } /* Continuous memory allocator */ @@ -1406,7 +1406,6 @@ static int bdisp_probe(struct platform_device *pdev) vb2_dma_contig_cleanup_ctx(bdisp->alloc_ctx); err_pm: pm_runtime_put(dev); -err_dbg: bdisp_debugfs_remove(bdisp); err_v4l2: v4l2_device_unregister(&bdisp->v4l2_dev); -- 2.25.1