Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9288626pxu; Mon, 28 Dec 2020 11:29:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUVpaJLpjDkKmi6HwlDqoQn+wvEqofTAVQCtWmS7/pzxvjdwwb+JZ5TfI7KZaCDZ622H4L X-Received: by 2002:a50:f299:: with SMTP id f25mr43163252edm.133.1609183791203; Mon, 28 Dec 2020 11:29:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609183791; cv=none; d=google.com; s=arc-20160816; b=B9wxWOF8Ys2Ukh5P6dvpHBX3YKIwDx/VUebXNKi2UJnTkZ2YNjFj9N9AuWBk5bEb4v +F3Eq1+NEAe1MeAREiBOdNWO6FuhU7VEX+KboltNPXWu7Y4dTUcqUYiDDzhMBRvh4LPP N2hR0dften1uhKB8jj/LsoOzz5GfaFUJ+NKlEFf8BNFJerQDpVqlI//31PFnnaXcQEDC K8p/bzizRT5ZW164dJyjELyznvY5FgIWxKa0SFUu3SVdDqVctad1OUNKFEEknyc0pdKt +ZTT7rc7XhQ24FHux4V1z4ao66CyJCUZCCnV1YoyE3tJVwCrfq2ewb7PAR8zgJnGZiUi yPOQ== 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=2AI8USg79KR6dkeHfKGEsmIZj8mBzoEO2ZYlWfbJ284=; b=hHZweJQfi1+mRQYQzbqh8VfFKB3q6L3iedoIqkFz77NY9xEttbPa1/186D/ZHw/nFr np1w9Wtle6DZEdbuHpBBTdJ0Th6jkxz/4z5e0I8wwzGBCOR3QeLXvs1QQWksmH0za0P2 v6GY+6xHOyoxzn7tExGAQdEK1DnV50rHF14uwwe68C5k3u+o9cPaUS3g3QVpmjeaQeu0 E2jzlrxeRtFN/pFLRuJNHe+gTjiPRSE1D3Ab8FTLLdafIlauvK1Xt3nbh7wP32vXmrPs AsTb7EDVWZPXJKrA+WMpkYhMGyu1UiOaYOvPaIJHIINMxVARRVWP4bIO/g6+TFatzYOc 1kjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o4llZi8h; 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 oy13si19068393ejb.397.2020.12.28.11.29.28; Mon, 28 Dec 2020 11:29:51 -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=o4llZi8h; 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 S2437252AbgL1OEB (ORCPT + 99 others); Mon, 28 Dec 2020 09:04:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:38276 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437247AbgL1OEA (ORCPT ); Mon, 28 Dec 2020 09:04:00 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 63F7520731; Mon, 28 Dec 2020 14:03:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164200; bh=yeK/LmVMYRH3jghtKOpucN5gXstQnTBSChteo6u/M8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o4llZi8hSjFTPquI0oJFg8E7H0wm1IHxE3QFHSWEStixHKv4pji/hfCm1KcWDy3O/ qRGnlLpPazK9tUtwczyaWyt0MKg3yEt6coL/BFdY3gI2JShlchF36f4KSrUAovsViM BU4hcM6C32/0nug2fXhZ4PcoiKmbBbbFMiQp6dAo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Qilong , Chunyan Zhang , Mark Brown , Sasha Levin Subject: [PATCH 5.10 096/717] spi: sprd: fix reference leak in sprd_spi_remove Date: Mon, 28 Dec 2020 13:41:34 +0100 Message-Id: <20201228125025.575333579@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 e4062765bc2a41e025e29dd56bad798505036427 ] pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in sprd_spi_remove, so we should fix it. Fixes: e7d973a31c24b ("spi: sprd: Add SPI driver for Spreadtrum SC9860") Signed-off-by: Zhang Qilong Acked-by: Chunyan Zhang Link: https://lore.kernel.org/r/20201106015035.139574-1-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-sprd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-sprd.c b/drivers/spi/spi-sprd.c index 635738f54c731..b41a75749b498 100644 --- a/drivers/spi/spi-sprd.c +++ b/drivers/spi/spi-sprd.c @@ -1010,6 +1010,7 @@ static int sprd_spi_remove(struct platform_device *pdev) ret = pm_runtime_get_sync(ss->dev); if (ret < 0) { + pm_runtime_put_noidle(ss->dev); dev_err(ss->dev, "failed to resume SPI controller\n"); return ret; } -- 2.27.0