Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp602491pxx; Wed, 28 Oct 2020 12:09:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJk093TJo6ih8IJ/HqZysiF5GmQ1wC5+KJy78CjtzVmAgB3dOG5O3zp8BtdcwGi8fUZkdF X-Received: by 2002:a17:906:b055:: with SMTP id bj21mr573704ejb.334.1603912150046; Wed, 28 Oct 2020 12:09:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603912150; cv=none; d=google.com; s=arc-20160816; b=cqz84VBwRg6OMbKpmTxdYU4QxDTzhKbwQKZ7VkwqIgImg/zXMjkj47caC00Z+l98Ky uPw+GsitLCRhDeOdb8Rc1gxT9yLEOfXSPl+G0FLSL10m076myfmlJysIBYj4BqlY8JhW W9MUWaQywJSSogwqsO6sBThTxKnlUyR8cdFjCAuzEYuUpol+QVqHXVAOU+FbhqDslYFQ FITqFKi7kkao2HAfQOaF0i3LZQWiqG3fFQ8wtPGKP7LccMxA14PIKr+1e93VQ8/DE+Su XjQiNqqWsZQqY7zBO4RgAI3QjJcwPz8OjoQcbpaUdZaQunKc0UeSpJxm+mD2jk6GcJ40 LY/g== 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=nDl2VqFE/bJMuRPA4gZbj2fGk/fZaPEfLevgpU6tekQ=; b=c4WYLLJtTAc6SjWJYLICz17Dl7FjZFqiOg2p4TRqcP3Wkr11GQZAdoZrB03isrr2wy nhf8DN6TpPBmFqiiPYOzijXygqlJ6YD1iJBFSPMbHV2vI29n1M2dayspxrQfO+wv6i+O Mrfe+KlFBMlQDXEKI650EkyuooRUORlI0hjI7erQvRQwnZAhuCAlmBVYdzHkk2lZObjX YunRVbWx94PuK6yQAMoXc4CvMowUOXatSGsvJN84hExmXWAT1IirKserXmkArSE/8jxE pVIQgGZZdSZbGonuI+hTByCI8Pk0Hsmb7owPv3USYkVO3BgqTQu0l+xRB2SA2IPxdGsN yJMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="0R+/6s5R"; 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 j13si1208edj.549.2020.10.28.12.08.47; Wed, 28 Oct 2020 12:09:10 -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="0R+/6s5R"; 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 S1826299AbgJ0SSg (ORCPT + 99 others); Tue, 27 Oct 2020 14:18:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:59808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2506898AbgJ0OLC (ORCPT ); Tue, 27 Oct 2020 10:11:02 -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 AF83D2072D; Tue, 27 Oct 2020 14:11:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807862; bh=iBpv/+Q85ki7UClkXoDyjvr5iE7xHj1vnd2xSUXZCvo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0R+/6s5RPcfqjtyFgzIuT4lGGKIMvLZWvxzskLzC0bNdq3MFpiDQ2hWM5/SCbvG6I 4aGOQhDVdR2Y8LcmA6CR+JYI1uou5/IKG/CrEAotuNYNKphhImwLwsvHwCUGnzJD4d Vov8E9vvEEw8LIbr7hx3r2AmKPIVf9PwlUYYwgkk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qiushi Wu , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.14 037/191] media: platform: fcp: Fix a reference count leak. Date: Tue, 27 Oct 2020 14:48:12 +0100 Message-Id: <20201027134911.532172058@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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qiushi Wu [ Upstream commit 63e36a381d92a9cded97e90d481ee22566557dd1 ] pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code, causing incorrect ref count if pm_runtime_put_noidle() is not called in error handling paths. Thus call pm_runtime_put_noidle() if pm_runtime_get_sync() fails. Fixes: 6eaafbdb668b ("[media] v4l: rcar-fcp: Keep the coding style consistent") Signed-off-by: Qiushi Wu Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/rcar-fcp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/rcar-fcp.c b/drivers/media/platform/rcar-fcp.c index 0047d144c9326..19502a1860cf5 100644 --- a/drivers/media/platform/rcar-fcp.c +++ b/drivers/media/platform/rcar-fcp.c @@ -106,8 +106,10 @@ int rcar_fcp_enable(struct rcar_fcp_device *fcp) return 0; ret = pm_runtime_get_sync(fcp->dev); - if (ret < 0) + if (ret < 0) { + pm_runtime_put_noidle(fcp->dev); return ret; + } return 0; } -- 2.25.1