Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp404546pxj; Thu, 20 May 2021 12:02:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1FFIHDSSkLTZeDtUHr4zaTPuMIS2tfjY65BnHoHPOL72H5PyxFg0Cvsw1TlTdWE5fLXcV X-Received: by 2002:a05:6e02:e42:: with SMTP id l2mr6603115ilk.189.1621537359545; Thu, 20 May 2021 12:02:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621537359; cv=none; d=google.com; s=arc-20160816; b=v70x0V1xweMJLFx+6H0cPi6It8WUdtDnxocq6m+QKiQe99oXIxJzlPIXh7XQJqlf4T YYBucOWlD19aFrjCvCBFBoMf66TqBIO/un1Gn1RTLTRB7r5izHYB1I3okADAIEChKiVO Mkd28GNKHvjcxtme+ZgQXXV4uOfrVbjSRsBgfpXCK7xi9UIkeMzydlzzggplfKwIoSzw tYhrxjNlTjRAoESkTkU/jUsk1BOnRjxTBht1JdSl6hCpt+FEiT/RdIhc34/yM9UKiMl1 y+zrTnqrJp0VxgBZabWZOonr7yfn+qK47/wIr/zLOLc9nLK6FCh8PFOfZDbnOXUgqVTl 6ARg== 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=+uqo7NRbU8CiImIRW6/HOUZcL8ot0hfygp8k0fQ66NQ=; b=akxTJsDrWo0nVtyFWMjUWW8WmP7re3y/lXU/fB9oK21AzbCQ1k7VsLic6eLeJP3uTa VDvSeHathCej0vzlmFQDTD/y6s8iZNOiy8IGY1Hn/7MZKrOYU6pY9CMNckoefacLISsr Tj2rkgZvLtmo6jxNYZLoJo4H2qY89Y4D3lYTCfvkpOr8H6F/7aqcxKgM8YwWFOcyH2Rb X1EdIdV62wHTR2ajtMy3vBD8cVrwo9caIv/sYLXKS+a7eyis7RdO4IXB0Qo271o7qbqq PgG61WlZlDsQYkdb6sCgibNRWJWc9n1w2aXv7lwKu3Am/kZWy55DMx8u2pA4MhR4hWte PNlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VnE3rXe7; 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 l22si3492383jad.10.2021.05.20.12.02.25; Thu, 20 May 2021 12:02:39 -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=VnE3rXe7; 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 S236377AbhETKaI (ORCPT + 99 others); Thu, 20 May 2021 06:30:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:48106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235858AbhETKR2 (ORCPT ); Thu, 20 May 2021 06:17:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DF3F5613C8; Thu, 20 May 2021 09:46:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503983; bh=QBZqKVw6Nhg0ITauxEPrGNp9cJHc/wNuEH+9A0vdLo8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VnE3rXe7i+Z+oyqtn3u/u+9P5UpRxNAVbyylvB1tF4fnd6DMYYluUvQQhPvPRybrQ BFwMGfD3edNlHc3UlwnU1GKE/o/SCM8QpYmPg17WKanfbHllYsxK3qcw6lRo3I87vm OnvYa50km0N5bI/Nnhl+Mk7HnXCt4bvyXd0mx4BQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wei Yongjun , Mark Brown , Sasha Levin Subject: [PATCH 4.14 041/323] spi: omap-100k: Fix reference leak to master Date: Thu, 20 May 2021 11:18:53 +0200 Message-Id: <20210520092121.514088819@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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: Wei Yongjun [ Upstream commit a23faea76d4cf5f75decb574491e66f9ecd707e7 ] Call spi_master_get() holds the reference count to master device, thus we need an additional spi_master_put() call to reduce the reference count, otherwise we will leak a reference to master. This commit fix it by removing the unnecessary spi_master_get(). Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20210409082954.2906933-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-omap-100k.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c index 76a8425be227..1eccdc4a4581 100644 --- a/drivers/spi/spi-omap-100k.c +++ b/drivers/spi/spi-omap-100k.c @@ -435,7 +435,7 @@ err: static int omap1_spi100k_remove(struct platform_device *pdev) { - struct spi_master *master = spi_master_get(platform_get_drvdata(pdev)); + struct spi_master *master = platform_get_drvdata(pdev); struct omap1_spi100k *spi100k = spi_master_get_devdata(master); pm_runtime_disable(&pdev->dev); @@ -449,7 +449,7 @@ static int omap1_spi100k_remove(struct platform_device *pdev) #ifdef CONFIG_PM static int omap1_spi100k_runtime_suspend(struct device *dev) { - struct spi_master *master = spi_master_get(dev_get_drvdata(dev)); + struct spi_master *master = dev_get_drvdata(dev); struct omap1_spi100k *spi100k = spi_master_get_devdata(master); clk_disable_unprepare(spi100k->ick); @@ -460,7 +460,7 @@ static int omap1_spi100k_runtime_suspend(struct device *dev) static int omap1_spi100k_runtime_resume(struct device *dev) { - struct spi_master *master = spi_master_get(dev_get_drvdata(dev)); + struct spi_master *master = dev_get_drvdata(dev); struct omap1_spi100k *spi100k = spi_master_get_devdata(master); int ret; -- 2.30.2