Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9043148pxu; Mon, 28 Dec 2020 05:14:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8SBQLfSV5pqs7FR7XaJg7v8yITr5ic3JTCsWym5STFkvpYywVlv25vEhUpNMAWJ2Gyifh X-Received: by 2002:a17:906:3781:: with SMTP id n1mr11846180ejc.296.1609161282707; Mon, 28 Dec 2020 05:14:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609161282; cv=none; d=google.com; s=arc-20160816; b=zsnrc+DNnaJMBnOh/ENNe7/IY3CVGWkKTpV7oZeWZ3qn1NV6gqrIQ1hhSt3kHjeggF 2DgorlSTqf1Pf5AAMgiAt9nAHtY5DuDteP6vc+oRw6boGyqZflgWXdADjoUHdAYX9IUg 8pAYP6ZE4N2jxZQMLYh0gm52l2VtvfeRNzxjUlckBkg33rExLd+mSLasYj3qk95vFBp/ MwR8C0/xC5WqlFxxkVBRZ4aZWzeA4LF5W02vvF8cCB0Rlrf9gSqXPZ/2wVLHEVImZ1Z8 D1VoEjnuXH6yE0SyYZJjZunLMpu3rA348vInAFlfloeLalTJ2Lo0p0efrWDR3fTDJx7t zIPQ== 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=UmjAQZBKq+WTb0rLAZGIV/A6w+CXntnC4tb8auE/4GA=; b=Hj6/Wj9RVxVG5ETJZ46gwBppYK8/nlmJFqKFGRFbY1xx9fGTzobq7dLF+jSnGy3WWI floZX9bxaOcGqhy0X0bHCaxVQ4VFBGTp+GZzIyBVWdoo79NF9S6ZuyE1SJJbAXoshXtA wkZD8gZl87kVn3B/Kg8bjFFbznZFHn4elOxHdb66fCoVur6GkYBRiWT0G4HTaqJ4aRcH /DVVOHMakJSxRqKYRodz7I6oZTJQsFk5fL3V9b+hXtL1mzo6bJx5Rm+zq1OCdFeCzsm2 M0GGrqsnTwGwBqAmxX1AWn+nHdVn49cnLZCayUFJVQUHdwhux6xCGcmoLrB+AFkfdJ7+ EGUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x03ljSe+; 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 v4si19907715edt.439.2020.12.28.05.14.18; Mon, 28 Dec 2020 05:14:42 -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=x03ljSe+; 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 S1732102AbgL1NMf (ORCPT + 99 others); Mon, 28 Dec 2020 08:12:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:40082 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732043AbgL1NMY (ORCPT ); Mon, 28 Dec 2020 08:12:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 60A9C208BA; Mon, 28 Dec 2020 13:12:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161129; bh=Ntdgzys9pNxmvBXWNqZtoLpmHbRUUGtqnnDd7boFn7Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x03ljSe+tswfZaGit86nQzJvJ7NLoaq+Vx+6asu44xGohmgbv2d0v3ZfihM5pfSPu afWRm87gniKFdSAKo+7XjQhaL+JD03bAfHHjktBfVpo3a4QUsoZXZbq/DQmmPecMnc V1KH9xoJNq2XexmtB9nLz1wevpsJz5eG4ze9zQsk= 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 4.14 081/242] spi: spi-ti-qspi: fix reference leak in ti_qspi_setup Date: Mon, 28 Dec 2020 13:48:06 +0100 Message-Id: <20201228124908.677235115@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@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 45c0cba753641e5d7c3207f04241bd0e7a021698 ] pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in ti_qspi_setup, so we should fix it. Fixes: 505a14954e2d7 ("spi/qspi: Add qspi flash controller") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20201103140947.3815-1-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-ti-qspi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c index d0ea62d151c0f..29c1b5d3ae7ad 100644 --- a/drivers/spi/spi-ti-qspi.c +++ b/drivers/spi/spi-ti-qspi.c @@ -180,6 +180,7 @@ static int ti_qspi_setup(struct spi_device *spi) ret = pm_runtime_get_sync(qspi->dev); if (ret < 0) { + pm_runtime_put_noidle(qspi->dev); dev_err(qspi->dev, "pm_runtime_get_sync() failed\n"); return ret; } -- 2.27.0