From patchwork Tue Oct 27 13:50:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 311793 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B53B7C4363A for ; Tue, 27 Oct 2020 18:13:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 61B6C207E8 for ; Tue, 27 Oct 2020 18:13:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603822401; bh=VRZBvPCxLU5XmRseVMUOC2aBAmrtipBqCxqBtffzeIk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=qWc+gzzbZQrLdycOmt9BsCR3q64zy1gEvT6IOk+PQCFFkuj8M6wr0W/eAiLTcVXEQ u9orSRv4VxvspXc9MiCyjivlRGimiBZWtJ/fL5gWcMwFrtj1uy3knTen2UF8faY2Hm AxsjF9FJRRFXtKPAvDHD4DJjsdm9xroVjkk7guDU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756613AbgJ0SNJ (ORCPT ); Tue, 27 Oct 2020 14:13:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:36140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756616AbgJ0OOd (ORCPT ); Tue, 27 Oct 2020 10:14:33 -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 9987622202; Tue, 27 Oct 2020 14:14:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808073; bh=VRZBvPCxLU5XmRseVMUOC2aBAmrtipBqCxqBtffzeIk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QLsmnuTGWJGR/oCli6E4KFgB9kNaCxueaySAPTXk1hNjV0ceHT6+Sy90Sq0cvm7oT E88Gr69cNkHTkKpB+q+jvhwRS57y8DrFs/zfHujgJHrfSqaaWXtIGc6QIcUMYCarlV IoDHYyxggLxKpQt7nswR2kBfkWoQsSK6YhJviwxY= 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.14 147/191] media: bdisp: Fix runtime PM imbalance on error Date: Tue, 27 Oct 2020 14:50:02 +0100 Message-Id: <20201027134916.780680670@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134909.701581493@linuxfoundation.org> References: <20201027134909.701581493@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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 601ca2b2ecd34..79de7d413cf5e 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);