Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9125681pxu; Mon, 28 Dec 2020 07:15:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJwbRZ1sFWS3QYXv5CtII7P3s4Us02z3aCjmFaiGo46O7xBpMBsvqnEK+LINhuh16178xrNr X-Received: by 2002:a17:906:e24f:: with SMTP id gq15mr43250424ejb.256.1609168503821; Mon, 28 Dec 2020 07:15:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168503; cv=none; d=google.com; s=arc-20160816; b=h6G6oigZqM7Kqia4S+wzVp4vH7h1XO1HnGCErKEZAwjkWI7U48L+SUjQXOmx9OHrvp xbg2djwIGp/ZyXqCP78OMcSTHFCJe0lr9eB4uO1n6UE3K/+BTh5HRPT9SU0dOwB5ELCV xefCJSgbMsqJ/TSS39L5zDcpHOsiAzlvLK3MSVJOL5908xNIo0hz1E57rvH3KD6ubBvz 7jbw3yppUt/BhSy1PGLsCIih/WEb1lwgO1C4SmzBKedBPZGyQVhbXRrTee0rsOtc9V/E zMKpppw5URzBN9MaO3i9jrp9dNqRCr8QhT5S9fd/BVQMV4IW61TgXUkBemYx9eBdNA9r sMTQ== 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=nkZj5SX6dgoenVygHxa3HlhWnS1NGi4iBppHNImnLnE=; b=ZiR/ovxgWudddSxM2oFFn4JMtpVc/rOGdhhbdLd38RgfdBLNcq98bqc2zyYWRbYips pti/Ja2iPwvbwmXhohwrN/p12h6n6vu2GBkKYKsqrDYih5979nKXeB4twnsWoh7ZNMtC +4/uxkHInzv2MZilRjcdfXLjSB72oY84lC4wTotC/Xw+9TEYYEF8+UVGGOju0hu9Opmr IL9cd+YHLLwJOnzOxYDZuE8lDuDkS5FOcejEZV1bsPe/PaWmgt7G638lVeuW4eytn+JP SUFO1wbe5Oc5AFjTVLsHBhlfcrLxTkFnTcreuG3dCq7wH8UtJfLAZ6643Kzf0RqHAFzA SYkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=P6zuHbWe; 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=pass (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 q16si19684286ejd.199.2020.12.28.07.14.40; Mon, 28 Dec 2020 07:15:03 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=P6zuHbWe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438398AbgL1OHQ (ORCPT + 99 others); Mon, 28 Dec 2020 09:07:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:40542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437871AbgL1OGO (ORCPT ); Mon, 28 Dec 2020 09:06:14 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 06ADC2063A; Mon, 28 Dec 2020 14:05:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164358; bh=uM8wcElyPBmjDfjfNNcNHri8j5m52cm+OCrV4o6HK/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P6zuHbWej235SpjS9AK7qOH+K+nSGrKQFWiY9AVNaignqIHHlwjkyFi0YbuQrHcb3 LCYbFglM+ad68R56Dx/q//mro9lml+teXuCxYOCLOczaWx3p0T4THbtom6h0jQSvbs Gunw+02ecAtl96GsqgJvgRc3ejJC+gmjGKXyieAo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Qilong , Mark Brown , Sasha Levin Subject: [PATCH 5.10 153/717] spi: mxs: fix reference leak in mxs_spi_probe Date: Mon, 28 Dec 2020 13:42:31 +0100 Message-Id: <20201228125028.288336213@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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: Zhang Qilong [ Upstream commit 03fc41afaa6549baa2dab7a84e1afaf5cadb5b18 ] pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in mxs_spi_probe, so we should fix it. Fixes: b7969caf41a1d ("spi: mxs: implement runtime pm") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20201106012421.95420-1-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-mxs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c index 918918a9e0491..435309b09227e 100644 --- a/drivers/spi/spi-mxs.c +++ b/drivers/spi/spi-mxs.c @@ -607,6 +607,7 @@ static int mxs_spi_probe(struct platform_device *pdev) ret = pm_runtime_get_sync(ssp->dev); if (ret < 0) { + pm_runtime_put_noidle(ssp->dev); dev_err(ssp->dev, "runtime_get_sync failed\n"); goto out_pm_runtime_disable; } -- 2.27.0