Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp749179pxb; Tue, 5 Apr 2022 21:38:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzATXQCmqySXevWDBMb2NTTC2qiEbEr2He/9zlOzzdva8iq9TnT+siX5A+dYbpbb5ZtzqSa X-Received: by 2002:a63:d14:0:b0:381:af18:8259 with SMTP id c20-20020a630d14000000b00381af188259mr5655045pgl.309.1649219915042; Tue, 05 Apr 2022 21:38:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649219915; cv=none; d=google.com; s=arc-20160816; b=Z+yWx+/CNp+XFog7BE31oFlgRTbx9zva5sMtCHIZPVkt3+JQBEzD9yDySG/QlmrNzZ fNpCtvROwlYMXYz95kQE4oOaS/jQZVHpkFvRyUkx3LrnR/pGP76qdrGXNqsfsfTwa4rl egiNg3J+b7NFvh3ztSy2Yequo3yw+Tt/CGCNE6BPwqGE5Pey9Wq6s96sHdDEJe9tIjaL BCQRCZ6m4ru7z+/YSfxX5P7Bp4ymxfr5rB94POObt2uoJ0bI9EiOzKI6zBbZlxYCJJY2 WaeZ8l8oXEMeynZ9T02AyoT95mRVp4nAoshtCa919/mxHmgxzdzT7GnKv4aCVb2qcAJA Nt5A== 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=cu17z4eoJzSkxbrOpWxIDYnRKCWo7rD/9m/Th/w3N7I=; b=bMqEHIyWe0bdnvUllWX7ya6HkJYU9Plt8KDyWgPCbAL54fjJ2NlgxGODf8+Zi1eGDP 4dfrinbFAp1EKSOs08rE7uUM9o95VKxAGJndNyjEtQ/VNZeGt2gUApPULcmDJsB0+v6W XbwJvWpfZrcRl94Ev+OcO+zBSxokYMttU6AdVLfAKD/Y+T5v+3YdwrkZrVF3JHM7rYjD vm9hwopDXeOqpUrbnHBRolelVD6+SbTspkw48kyNCyy/iCRD21Y6thW1fYPrgr5nCPyJ p/um14qdvN5yQZXSEfdXSiMyYR6pOn9yl+Xjga17h1c74266VYFY3pDcAqgodSEHttE9 rlVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SizHnFxf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t1-20020a1709027fc100b00153b2d16541si13695164plb.329.2022.04.05.21.38.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 21:38:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SizHnFxf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C9F6D4EDD2; Tue, 5 Apr 2022 20:03:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377387AbiDEL27 (ORCPT + 99 others); Tue, 5 Apr 2022 07:28:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243547AbiDEIuk (ORCPT ); Tue, 5 Apr 2022 04:50:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 261D0205E3; Tue, 5 Apr 2022 01:39:05 -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 D7E7361535; Tue, 5 Apr 2022 08:39:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E40DAC385A3; Tue, 5 Apr 2022 08:39:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649147944; bh=AE8siXgTZ1H7IScJ7cFvEU7Ff6JT4XzexfIs6peE5Z8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SizHnFxf8y5VdRkO9tae6BtkxTekJvB+Id1H72VpLr2u9UVH2rkoZT8LynPgjjI1J bZQH8M79Axh9AXoSvWu4SjYb16QXFYEcxehYicSSB0jh4imb7mqLcVS4QfKAts5PUk MX7a29JzslSaKoLovycbddghTp8MVuZIxeWG0FYw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kevin Hilman , Johan Hovold , Hans Verkuil , Mauro Carvalho Chehab Subject: [PATCH 5.16 0178/1017] media: davinci: vpif: fix unbalanced runtime PM enable Date: Tue, 5 Apr 2022 09:18:11 +0200 Message-Id: <20220405070359.518863423@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: Johan Hovold commit d42b3ad105b5d3481f6a56bc789aa2b27aa09325 upstream. Make sure to disable runtime PM before returning on probe errors. Fixes: 479f7a118105 ("[media] davinci: vpif: adaptions for DT support") Cc: stable@vger.kernel.org Cc: Kevin Hilman Signed-off-by: Johan Hovold Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/platform/davinci/vpif.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) --- a/drivers/media/platform/davinci/vpif.c +++ b/drivers/media/platform/davinci/vpif.c @@ -428,6 +428,7 @@ static int vpif_probe(struct platform_de static struct resource *res_irq; struct platform_device *pdev_capture, *pdev_display; struct device_node *endpoint = NULL; + int ret; vpif_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(vpif_base)) @@ -456,8 +457,8 @@ static int vpif_probe(struct platform_de res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!res_irq) { dev_warn(&pdev->dev, "Missing IRQ resource.\n"); - pm_runtime_put(&pdev->dev); - return -EINVAL; + ret = -EINVAL; + goto err_put_rpm; } pdev_capture = devm_kzalloc(&pdev->dev, sizeof(*pdev_capture), @@ -491,6 +492,12 @@ static int vpif_probe(struct platform_de } return 0; + +err_put_rpm: + pm_runtime_put(&pdev->dev); + pm_runtime_disable(&pdev->dev); + + return ret; } static int vpif_remove(struct platform_device *pdev)