Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp563467iog; Mon, 13 Jun 2022 08:12:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzq6lM6QbiN6BB8kSnrdehe457hEaO44ybBaFdocHKhFPHdMX/x+lIUgYI8hkIrUHpZnbwj X-Received: by 2002:aa7:93b0:0:b0:520:7113:4187 with SMTP id x16-20020aa793b0000000b0052071134187mr52420pff.35.1655133163906; Mon, 13 Jun 2022 08:12:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655133163; cv=none; d=google.com; s=arc-20160816; b=DBVwPFCFWxx6AgWIJE65G6qQnprFIjdOP6Fq9pFBSXJQsDIJS39lD8EpNaMVJEb7rl oJXfuk1y2Q9N5xtRwKhivaoh15nSyjdPtq2yfP68n7xqwk0LgtsgvmNR3Y0ReQbrIGSJ IMJrdezbAeExX2N4UfGFgiy2Z6JO8auGqVBqwazWTeYpC3vJT7EbvqkMxrxkn3mZtyqq mLkkMfmCoL1QN69nVL0U2VmPLEfWYkxsXQWVZShV0DR3BTh0fA1I4cWTj2Tc1IpJ6Nu7 +nQLCdGS+g9aZ88aVnf4nNlJUP0qnRrPNtNSGG7GcKoMdVhdHuKLkVDsR67RN0FRV8rJ xBsw== 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=P7WSNOitk22Gr3+nCCUFL73tMIW9DKb5kzscdvE3/BE=; b=tecfQVMd4vbkzs6es/ytePW20pjmHFsdfFjGFU8M0MUoDdJHprt3Ms+UaBhfG1OHzL urU3nCuyl0NFVqhPLnrkPRCG1SQdZ9LxxVgU82+ulb6vZeij3lx718MGLzj7CaTvwLrp hWUTAIEhyXf2HsiqPmoJBY93L4wblG5Ybypf6l2jKPrnqFJ4+M+QPkXLAR/Oc1Tv//Lb ws5o//zCvdu8xvEo+VXk1rUZrjaAqYLlox5g6TO8PRd5iWaYI1Bl1aFSqgB3ywP0DL0o SYRqm8nQDWGZDk12i5zSp1BmPMqXVAggk5rCR5FhOUq3l5ZmRr/1lCwpKTpGN/UevoZJ 5MhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fPGuwlaq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h5-20020a63f905000000b00401ae0f4a06si9633345pgi.577.2022.06.13.08.12.29; Mon, 13 Jun 2022 08:12:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fPGuwlaq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1344536AbiFMKr0 (ORCPT + 99 others); Mon, 13 Jun 2022 06:47:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347036AbiFMKnu (ORCPT ); Mon, 13 Jun 2022 06:43:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A66F0DF2F; Mon, 13 Jun 2022 03:25:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 283D460F07; Mon, 13 Jun 2022 10:25:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 367D4C3411E; Mon, 13 Jun 2022 10:25:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655115902; bh=X+yRmY49qQ+vJXONkRbFaKbxGptgVbKxURcw4SeclfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fPGuwlaqyp5M768vRM16h5RtKr980l41X7J5750AA6vv9V7cOxcN2owfg5l9DXICi Ql8ixXK/XAv66stwItErrUGHM+peqgTOO6VyJ+9I2//+YoBVIxFjm+u7bimEeFQWhh tG152cQTtqLZlw1lbTy6gTKNZ0nfUtxWagb7k3YQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Hugues Fruchet , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.14 072/218] media: st-delta: Fix PM disable depth imbalance in delta_probe Date: Mon, 13 Jun 2022 12:08:50 +0200 Message-Id: <20220613094922.435447285@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094908.257446132@linuxfoundation.org> References: <20220613094908.257446132@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin [ Upstream commit 94e3dba710fe0afc772172305444250023fc2d30 ] The pm_runtime_enable will decrease power disable depth. If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). Fixes: f386509e4959 ("[media] st-delta: STiH4xx multi-format video decoder v4l2 driver") Signed-off-by: Miaoqian Lin Acked-by: Hugues Fruchet Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/sti/delta/delta-v4l2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/sti/delta/delta-v4l2.c b/drivers/media/platform/sti/delta/delta-v4l2.c index 7c925f309158..a489d0d17989 100644 --- a/drivers/media/platform/sti/delta/delta-v4l2.c +++ b/drivers/media/platform/sti/delta/delta-v4l2.c @@ -1880,7 +1880,7 @@ static int delta_probe(struct platform_device *pdev) if (ret) { dev_err(delta->dev, "%s failed to initialize firmware ipc channel\n", DELTA_PREFIX); - goto err; + goto err_pm_disable; } /* register all available decoders */ @@ -1894,7 +1894,7 @@ static int delta_probe(struct platform_device *pdev) if (ret) { dev_err(delta->dev, "%s failed to register V4L2 device\n", DELTA_PREFIX); - goto err; + goto err_pm_disable; } delta->work_queue = create_workqueue(DELTA_NAME); @@ -1919,6 +1919,8 @@ static int delta_probe(struct platform_device *pdev) destroy_workqueue(delta->work_queue); err_v4l2: v4l2_device_unregister(&delta->v4l2_dev); +err_pm_disable: + pm_runtime_disable(dev); err: return ret; } -- 2.35.1