Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp235361pxx; Wed, 28 Oct 2020 03:40:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymFGEztXIgddF5z7CswHBpPtVMGx0OOIoMLIi4VYUkBDE7vpZbIQp4JHUcoCQ6lGFSpZ6u X-Received: by 2002:aa7:d28c:: with SMTP id w12mr7030999edq.248.1603881624802; Wed, 28 Oct 2020 03:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603881624; cv=none; d=google.com; s=arc-20160816; b=pcgsrQgb36xjUT89QArXi0S4GJrD+MRopylXonONHRXt3obahMEr8ChqXyyvG42Nz6 +yQ5BEqZoCNAzn5P7QMK8LqGWX4ncagrYMqvGspyTyXSdo3CIDf+dvWTlNDrrRIh5YXo pHY4gUWKLYtMdWYIJhcbu0JlWk2XPWOHJ40o6de4YDFnXasHuzdJ2VJXzAip5g69fFJM tobmA03tHmgMrLYFf/V5zGc/YUBqf9yzESRABBRb4NzV0VjdegaycHgpVhf2oslDgu0n fV/hO21ZV2ylD+oCU7Un2eTJee+equB8Nusnp9d+VmwyQpBs+QTb8oaNHk1Jr96f6l7G sPWg== 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=9W8a6h+H8YzzryXnpg5RpGCwRrCDv9zsHGqtdcGDWNw=; b=XfPM/zBPjz4szGMpejtkwReRKoWT7sicFDZ7tk3Cm2BibiqBU0qKeyOp+7pZr9MZzp 3t8fTBkF/EvikDKV9QBhEGSS2VmIu7BJLuuC6HMZmtdIjLpz3tikZ0ezBUrCnrlfwduq A/YN6mAiX4O+qQsF4n6u3r4Zpu4Q8qM0DM+UAAHxhJ+GWIMj3axpSi9Zs5slCPaMUuVq q1MZr++NOiJtlAZaDcL3BlfNqhn+wLi+l13xZcsHK9e5/j9sz/149FMUyaf6cuBPCQlN xrTp+Oyvzthbpbyd1TOQ09m4hywmzNC+AL8frZpDh4DXzy9XmNQediSkSS8RegiJS2Ni gSRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ef1tXaXv; 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 g1si3663191edn.100.2020.10.28.03.40.02; Wed, 28 Oct 2020 03:40:24 -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=ef1tXaXv; 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 S1763753AbgJ0Oot (ORCPT + 99 others); Tue, 27 Oct 2020 10:44:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:43948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762347AbgJ0OoF (ORCPT ); Tue, 27 Oct 2020 10:44:05 -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 2FD9820773; Tue, 27 Oct 2020 14:44:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809844; bh=4DCuPeW3yW2U9oJ3tflmq+0xSP9pSKrKh9VbhaYRndk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ef1tXaXvgE7S9syYkfzlwLED2mYB0bRXO0TXzhD3ucV0qv1K/c4eYPFbsHMM0Q5Pq q3vKG8RtxVNALbencLGpXx4MhgqA1iySCerG4done6sUppOghY2w/3cBXj18gcevqH bAbp49GoWo40BEfY9+S8yD0VRW9A1xuG2tlWmzpw= 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 5.4 339/408] media: bdisp: Fix runtime PM imbalance on error Date: Tue, 27 Oct 2020 14:54:37 +0100 Message-Id: <20201027135510.762377503@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: 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 675b5f2b4c2ee..a55ddf8d185d5 100644 --- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c +++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c @@ -1367,7 +1367,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 */ @@ -1395,7 +1395,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