Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9075215pxu; Mon, 28 Dec 2020 06:04:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVko00F6/3G5ZUmsMENNHSRPfvbRQFc8nRh7cdr7Q/9zX5fiAM2OFZS96l7BBWGhoARwxQ X-Received: by 2002:a17:906:6606:: with SMTP id b6mr40814310ejp.151.1609164273097; Mon, 28 Dec 2020 06:04:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609164273; cv=none; d=google.com; s=arc-20160816; b=UQkGYy1pPZ09ZQgS3FX2D0VEx894E5LffyjewHkbcgHVf6SiVfSPurLOg9CovU2Jiz K4JwpphwmQEGdNaqT/kVMlNcdDg03wG5blhJw5dJX1CDwG2SbrNEPHUNk6tHOgBkmLr7 0XRgDcPxyjyQKzHXDNqgTjnejPMPbAVEV5dC8HWLmdRG5pNBpFhk4zyVQxADNiH1oS9P dGakXNFRD51tiSjP7wdL737n8A0LRiR8wGLDiOwjs+f4QMm4BAJEsFqhCZtAMNbuFwIS Ez8H43cylGuGDO8V0vdbQk0ARaGP8sWzDebKZzn/hkuH3P5pj57MW0AsbVGnYvnNt4MR iNzA== 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=ooNMlawuXqlUWEByB+8dQDdxaDMNjUvLGBq6++xdirE=; b=hjXmesFY4J5vVQOArMegRWflpMpLKLVFZuRF2sHo0z+mHpW8CLSDmDWQryHEI68xzU EHsiUe7Y+L9kG3lJCAOQO29nil/8YQuVS+kvSAnsRs1WTCcR+S0uRO3zvWK7t2RnV7hB RHociSyqFATWqN6fe3ecmTlwj9TO7+AbC9o4l8VPa4Ra1rGBm0qiBmGq0OhgAAc/ZVz3 xP2P++belPSERqpEo46Gbd9/gOZ92M8Ed/+cCt3szn8U7CvLxkXkucU685cPLbNWaKDt jOzt+cJH2eUOCrrUO9rHPdKohBjiBfJq0HLUKwo9cNpLhB+SH1XU5A55yzoKJ/epNUaN rIPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=m6xc8QmQ; 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 f24si19844891edq.247.2020.12.28.06.04.08; Mon, 28 Dec 2020 06:04:33 -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=m6xc8QmQ; 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 S2436770AbgL1OCG (ORCPT + 99 others); Mon, 28 Dec 2020 09:02:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:34824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436703AbgL1OB5 (ORCPT ); Mon, 28 Dec 2020 09:01:57 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D77C3207A9; Mon, 28 Dec 2020 14:01:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164102; bh=uKGek1V1AUMjwNKvp+zpfADHkjF89Gvoezw9yrt/WsA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m6xc8QmQfnYEEbbPrYsSMWkP2BSuZl60cK3rC4FAKhCLvOmFBK+lynnuQBEHBIJ7Z OcFGVL4b8N0i25mxgoNxrrLV6aJOMwEhoJ9AJI0wkNBDjjScF8zhmScBRUwHcycl+t 46c9nw6cXpgcQ6h5v3TO4DsDaXyO2md+7vbji61Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Qilong , Alain Volmat , Mark Brown , Sasha Levin Subject: [PATCH 5.10 061/717] spi: stm32: fix reference leak in stm32_spi_resume Date: Mon, 28 Dec 2020 13:40:59 +0100 Message-Id: <20201228125023.920595242@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 900ccdcb79bb61471df1566a70b2b39687a628d5 ] pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in stm32_spi_resume, so we should fix it. Fixes: db96bf976a4fc ("spi: stm32: fixes suspend/resume management") Signed-off-by: Zhang Qilong Reviewed-by: Alain Volmat Link: https://lore.kernel.org/r/20201106015217.140476-1-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-stm32.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c index 2cc850eb8922d..471dedf3d3392 100644 --- a/drivers/spi/spi-stm32.c +++ b/drivers/spi/spi-stm32.c @@ -2062,6 +2062,7 @@ static int stm32_spi_resume(struct device *dev) ret = pm_runtime_get_sync(dev); if (ret < 0) { + pm_runtime_put_noidle(dev); dev_err(dev, "Unable to power device:%d\n", ret); return ret; } -- 2.27.0