Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp561707pxj; Thu, 20 May 2021 16:17:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRP48kFazQ0FDZhOND0387ODG8jD40d7dxPK4jl697pcdiMfz4xaaq/7fmJ8I1EG4uV4sR X-Received: by 2002:aa7:c0c4:: with SMTP id j4mr7391724edp.168.1621552623074; Thu, 20 May 2021 16:17:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621552623; cv=none; d=google.com; s=arc-20160816; b=csGTW8TIDbPnPjCiOfwFiO2bKl4oEcGgzzniluLGpiae4YF3QpDw1NHLQE+HQt22zd n/r2pdbqgSvdwf6NLDllxVVUkXeGbQu9WPg9bmEYz448z21caTZZLNVzPHUJ9XqtOk5F TB88HZoo77AvIxzlk3nCQCnBFDw0bxLtIDpWz8lGLWJuQZJQsoBlUrSOibHXC6x1hfBb 2XelriiDzKt5rZK+23gLFqIQUcalucmxlWKESk07YWZxFaZYm3nCNnXP3vw2jC6a20is 9edXdsXJbgSvIalDJn8S0RSp6CTzgHfKa7lxGqmy8kxn0b5XEGFPWfLXon5vSEH7qF9K Ahsg== 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=oBw+MrokVOh/ahAnCPnvRvkAUIoGeDIcUc1tLfCrUdPGfche3lmcXKSF+BCqXo0T00 XNMnUE5aYrSlV3pm5S8l3Q40fv1QFLbcmEf3MfywKlTRWaf4SQt68Bd0nBGWZUpG4FCw 6ffEShrtHo+nLolyH60b+S6bDvVgtcdvIzPPO7/+5SPt8sgr4mWApJhcXSidY5BNlrti WqGWjM6J4py//HOZPy147okIh8/FO2pgTgO6wuV5//u4Hweqe9Lp1UiCfU8ALeD3JjKH 6ucwETcpxeAU9VL4DUxIGPy5dRx8FIvsLX36pnVcX2iSNElt0e859XI8zIjhQwxk8kNX cMfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LS1QYS1Z; 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 a15si1712911edr.48.2021.05.20.16.16.39; Thu, 20 May 2021 16:17:03 -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=LS1QYS1Z; 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 S241169AbhETL2h (ORCPT + 99 others); Thu, 20 May 2021 07:28:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:40950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238442AbhETLIf (ORCPT ); Thu, 20 May 2021 07:08:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 568EE6193E; Thu, 20 May 2021 10:06:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505185; bh=QBZqKVw6Nhg0ITauxEPrGNp9cJHc/wNuEH+9A0vdLo8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LS1QYS1ZQrGjIyV+BvJPz6R/ezBAe7tITJAJYUgHf/72cEsCm9g+LsS664BHG97EX CIeq9dyclINrtWY7wV1StZXd1ZwtjuOu8LYAfV/UMmk/HQ6w7GqojuqmF9bsDJl26i r2J09CiA9N3qfjvPW7dmdVedXyuECKJOBT8w0xWQ= 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.4 020/190] spi: omap-100k: Fix reference leak to master Date: Thu, 20 May 2021 11:21:24 +0200 Message-Id: <20210520092102.835244630@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@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