Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2476082pxj; Mon, 10 May 2021 04:02:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkDUoim01V9WrezgvN1+Nandb4eyPK0IoLWNR087EggSogeQcI3Mw9taYjVZdPP09FYdCC X-Received: by 2002:a02:cca4:: with SMTP id t4mr21312157jap.67.1620644550768; Mon, 10 May 2021 04:02:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620644550; cv=none; d=google.com; s=arc-20160816; b=wP8yA/4VpRAZI4RpwHuqsRsngeteq27TBNPODvJIJDe7or2gNQmxlInCVijRrsD6Lk fTQaIz3vFDDHGPsDet1yPU5iUKj8bYa1taN6tGvGQdg0/PytOVw3wLui5tPZY84i3S63 lmKsuR3zU2uvdY9305dbRD0wTvPoemSX0FqkFIDqGE608M7o/mIJrKbahHrrkzYmFP9S vG1W9Qk6PMeMaCjLEi72beJ9EL4IMgeejP5bh5SwHZz1EKV8tAeZgeb801//V5Z+nqPU Yolul9bj/wX1VeH92GtlTCgw5W8TaHlsCJONiZheMqrM1HhWKzFluZ2dCfzigAFT6vqc jTPw== 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=dyOY/kezoqRY4eerwQuI2ee4Tyq2PbAgSk5ey+auoIU=; b=D3Z4zTOA7ih4Lkucj8cwyC0MH5N96OKvKAzH2IoFvO8yP19tNMX7f4Lz36y2NrVScQ RgWQmSUw6Xv2q1rpOJ617wKpFzkyaIS7OKNRByu/EXtyr8m/atHAktVE4uXakkKCCMyO AHQT9twFJZDN81Dz5TK5fES6Ootihr6QLIR1/W9JjiW6aC7BYXLaoNqJjzdAFbrxmcAq qP8Uvw6M+efZxzcovKNBk9mi96rjah2IgrY7sIilM6FIaMi9FK6Y5dx6/eQPO/LC2vNb ECJQe7nifbjzZ6Wb+nDhnmhb4edQnWDBtf66ERJdJfwcO89et57q8Ve+UJ8AJWy3GR2l P1MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fG6RiBHE; 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 r13si17694927ill.120.2021.05.10.04.02.17; Mon, 10 May 2021 04:02:30 -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=@linuxfoundation.org header.s=korg header.b=fG6RiBHE; 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 S235205AbhEJLA0 (ORCPT + 99 others); Mon, 10 May 2021 07:00:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:52756 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233163AbhEJKpQ (ORCPT ); Mon, 10 May 2021 06:45:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 89F8161990; Mon, 10 May 2021 10:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642890; bh=BZ0ndxHIGXHhwN/T9tjYm4VD+c2e9yJki+gYk3dhELo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fG6RiBHEg9ixJB96eSfkVIgazncm8ZVemCn5BaEZDshNJKWQ/ol2wBPZ+k4qsALYH ncQi+JRg/nFTmqc3aQr10yPMCBnLGMptSLHOEiJhG9tRtutFh/g/dhzWHR5pRYAlYD O+HDY+9CwDuArltsHco1WKhX5lKiPB5pUS4/B0tk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wang Li , Manivannan Sadhasivam , Mark Brown , Sasha Levin Subject: [PATCH 5.10 094/299] spi: qup: fix PM reference leak in spi_qup_remove() Date: Mon, 10 May 2021 12:18:11 +0200 Message-Id: <20210510102008.043293278@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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: Wang Li [ Upstream commit cec77e0a249892ceb10061bf17b63f9fb111d870 ] pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Reported-by: Hulk Robot Signed-off-by: Wang Li Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20210409095458.29921-1-wangli74@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-qup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c index 8dcb2e70735c..d39dec6d1c91 100644 --- a/drivers/spi/spi-qup.c +++ b/drivers/spi/spi-qup.c @@ -1263,7 +1263,7 @@ static int spi_qup_remove(struct platform_device *pdev) struct spi_qup *controller = spi_master_get_devdata(master); int ret; - ret = pm_runtime_get_sync(&pdev->dev); + ret = pm_runtime_resume_and_get(&pdev->dev); if (ret < 0) return ret; -- 2.30.2