Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp294617pxx; Wed, 28 Oct 2020 05:14:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP0oBalhBOiWgYjd9Qsh5qZcdzZyOHKcdKeJZqY0oIA2cH+4O5uimJQzXgHQShl7zcmreZ X-Received: by 2002:aa7:d948:: with SMTP id l8mr7414588eds.159.1603887248923; Wed, 28 Oct 2020 05:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603887248; cv=none; d=google.com; s=arc-20160816; b=oHFqwighIj9p4UUkGeAU+re9Nnm4gIyHunK7mX2733iAr2rhl7w/lRe5uVZnzSdx0G gJrJ61jCI3XKoYR8qk8cjJbeb9DKuBUhxbrVI+pQXjBMGOx8NFd68Z0Iagd4iEOPiHxp YPPoRb2l0AJ5nIUoFJ3V3xdR6EMzX6xHv7IlanFTe/2HhJyn2E58P5G+cqCSjUqNGwUv LaFx+24uxm+7ftwiLV/vmY6hPK9cxU7hHMkLOL4bf89koFgpvL+me2jALEKYaDTMydY5 Pxo86vrDH20uCeRreeedyn51iWvPfyECAGPyK9wWBUHZ6me4zdb/YXXQfe0JOwZ/KS1e zHvA== 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=CVA38Ou0meO9Vp2Ep19riKw13AdL177VFgA3OpiNTic=; b=zRHUMDhCWZHaowS48HLICL/ZPfvZRiHHwMb/yp7JRddfJGH1qLjGn6veeRqC9lofCg rdd3lum9W+7k/56D+HHeI3A52J+AdxuJuojxIA2VEFb8vwYs7Cq8gXGg3RTRTvb7hHaF qFQozPfAHTYO6tuy5/83lHDcbpiWCHbx3ve5WguKx5leIiFtEiad87gBvUGyDwVbLHXR irYDPNC/axhQMTVfRhQepaoPkM+dDqUlhh+eSEuOg1I4Qm44EXVV75XV0dZ8+bL9fKN2 nsHv7np9DtDJyNISzQsWhiMtQ1MUFSBo4Gh7Bm6XiIqdv5BE5W9C05BwF7HslgpkPzwL /qDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="mKrH+2p/"; 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 x26si2664388eds.99.2020.10.28.05.13.46; Wed, 28 Oct 2020 05:14:08 -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="mKrH+2p/"; 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 S1795956AbgJ0PPd (ORCPT + 99 others); Tue, 27 Oct 2020 11:15:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:49546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1794659AbgJ0PMz (ORCPT ); Tue, 27 Oct 2020 11:12:55 -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 161AE21D41; Tue, 27 Oct 2020 15:12:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811574; bh=XiJLm7dJT4iYtMQfAyf59AS4prF8Kb681A/GW+JkWyM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mKrH+2p/XGhRsBpF1/2xU82u6LwCVjSohQQCbUj7GDJX8WzeJdv6yyozevjiow/W9 cXNfPEZZ/1pg8yc6UKU++cPQNh2WTgNbJ4vr+bsPeDIzc3Yu7JmcRe3NdHJ52igzX9 GVsslhLSeGG6axWFifaQpalmU08cDh2VaYLq037o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Sylwester Nawrocki , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.8 541/633] media: platform: s3c-camif: Fix runtime PM imbalance on error Date: Tue, 27 Oct 2020 14:54:44 +0100 Message-Id: <20201027135548.168118603@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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 dafa3605fe60d5a61239d670919b2a36e712481e ] 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. Also, call pm_runtime_disable() when pm_runtime_get_sync() returns an error code. Signed-off-by: Dinghao Liu Reviewed-by: Sylwester Nawrocki Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/s3c-camif/camif-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/s3c-camif/camif-core.c b/drivers/media/platform/s3c-camif/camif-core.c index c6fbcd7036d6d..ee624804862e2 100644 --- a/drivers/media/platform/s3c-camif/camif-core.c +++ b/drivers/media/platform/s3c-camif/camif-core.c @@ -464,7 +464,7 @@ static int s3c_camif_probe(struct platform_device *pdev) ret = camif_media_dev_init(camif); if (ret < 0) - goto err_alloc; + goto err_pm; ret = camif_register_sensor(camif); if (ret < 0) @@ -498,10 +498,9 @@ static int s3c_camif_probe(struct platform_device *pdev) media_device_unregister(&camif->media_dev); media_device_cleanup(&camif->media_dev); camif_unregister_media_entities(camif); -err_alloc: +err_pm: pm_runtime_put(dev); pm_runtime_disable(dev); -err_pm: camif_clk_put(camif); err_clk: s3c_camif_unregister_subdev(camif); -- 2.25.1