Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp651589pxb; Tue, 5 Apr 2022 17:21:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHOOQSu4HQ4Rcn/ZeTlXGYKOuZ7E//mTkkA1vV5/ARw5shtS0NBhi7PA75ox+N3Znu2mp5 X-Received: by 2002:a50:cd97:0:b0:41c:d36d:b8ca with SMTP id p23-20020a50cd97000000b0041cd36db8camr6106064edi.256.1649204503431; Tue, 05 Apr 2022 17:21:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649204503; cv=none; d=google.com; s=arc-20160816; b=nkMpvBodytosQiJMKnX64a7JgsGsIke5C62haN+pnnACR0EB8utOT2DHG3w5i239PF 13AvGZ/M7QiYqgLmgq7OjHzNGLQbVCWcRORtFkZlH+ToTENG32phNBnoqBAgkscg3K0O xjJhS7VWtYjrKJ31C5smB+Hgp+qF1gXJdEmAFlrFRvxy29zPcGZQv218PInJTpYuNK2J mQ1bqGqMmAEVnKOA9tL9oBPJB/F13xZbbrcRf83slOpUpcBAckR+Ov+f2MvGyJh6u12q 7/v7oM1tgk2m3t38GGMQi19jSaXAXB1wOTSLzwtknNMM7hStyo6sDI7PKGyq8Sy4WoGM VRMA== 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=BRwhJM1Z7deHxIGHofXSuTt1yM+ehbRaT+tbEAMejuE=; b=KKOJ0Bkv2zIcUcE+Pq9o1cXOjip32mfUWsYLvosKNXARIikA/z0Fc3elTpbqgIPyqo ys+tIniP9gvo1fqzyD18AdhlyyjzKSMXyCEbdIjVdcjG5YxFrOieWgy3ChXnCG4CX7pF 1rz88v2hKf7GF3umVy045fWvKYEP/SwHBijCuVczVpFTyWxlm+sZICG5W3ys0gxExd/l 0Ogo0czcFnaEyYW+r3eMinNyoJS9xkOFZU0Lz59mcYouV13oMyDSZpZ9NOTqQSLrPdA5 nU2sCG6ABSg4hKcLZY6GKUFbnbsxem69FkMt5idDmmdfjUQeFEdkAg8F0ad2GamqaATd WMQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FkAB7Ny7; 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 f11-20020a17090660cb00b006df76385babsi10547531ejk.75.2022.04.05.17.21.11; Tue, 05 Apr 2022 17:21: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=FkAB7Ny7; 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 S1389645AbiDEOpM (ORCPT + 99 others); Tue, 5 Apr 2022 10:45:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244354AbiDEJlP (ORCPT ); Tue, 5 Apr 2022 05:41:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0E4EBB0BF; Tue, 5 Apr 2022 02:26:14 -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 ams.source.kernel.org (Postfix) with ESMTPS id 77B79B81C9F; Tue, 5 Apr 2022 09:26:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB6FDC385A2; Tue, 5 Apr 2022 09:26:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649150772; bh=33/NsFJ6S6oP06sE6HiusXdLZSv2jN/hv3xFSD2FsBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FkAB7Ny75dyVbH+ky0LmC08wrm6WdN7NIcoAoSm20LhSOkJkrNjqEGm9UDkz/K+1N f0pQrpm+l8pTWCCjT0Hw1jElHBFSHgSpgSOY3Wv/cQPo4CRDfewDH1RC4kapRmQclz w8zhsd1QnjnAcR2j3eo+kEqk1tF+PMBYcdElgdMQ= 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.15 168/913] media: davinci: vpif: fix unbalanced runtime PM enable Date: Tue, 5 Apr 2022 09:20:30 +0200 Message-Id: <20220405070344.884558327@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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=-7.1 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: 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, *res_irq; struct platform_device *pdev_capture, *pdev_display; struct device_node *endpoint = NULL; + int ret; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); vpif_base = devm_ioremap_resource(&pdev->dev, res); @@ -457,8 +458,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), @@ -492,6 +493,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)