Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2472886pxj; Mon, 10 May 2021 03:58:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPDTbBU7uG7W4bkyzAGPOz3KUNjPWc1f9FaJLTP9AxgjaX8ftXQmf2beijjl53H3tcaqzJ X-Received: by 2002:a50:e702:: with SMTP id a2mr29278907edn.3.1620644288277; Mon, 10 May 2021 03:58:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620644288; cv=none; d=google.com; s=arc-20160816; b=hgeXjzxFdfm1AzAS2Qdv77YHcLNhKr+xGT+0P04XU7xlJ/UblBpOvrZIfJQAhMY5Rb BKVuA4y+lNTqCGoawQ1WOD8Un8dxsGBc8NFMDq1bVNVw875cYMLy9Zl8sSmuLpXN1v4w YZu7U+kc9xkIsXybNkNJ6bEdMwKrotFNHxwj/XrDznnZ7L0s1T3Kz0CSSa5+gX10XZVC dpmV77wU1KSCAt7Pms8/QbqY1zsjxvqE5ItO3co/hq3eeBfp+CZZghtLpuoUGrkFr+5B a9ixDzd2Haz7NM3g3GQIcYvQR3zn9zP2brv+0SAIDwkjF1gSAbr28MOcxOKb8b1RqZjp 6+iQ== 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=+E4nigSD5ApRyUbw8qCbQYVzgqTz39Qn1HjThOm3wiI=; b=PanW4P+/sYnTYKHlYvjP0ItAKb4G9thBEP9w6474BXkamZaApH9lGWe+LgEiIcuyu1 4uuKTSpBNrCVXAqVwB7uEwaA1GErmwrZ4u9kg3tpnr+FZapcG7F+I14D5EykpDGX05tb EFM3IFXsbfwNUfU5Kn7PIiaTMngtSSU7Ij6qMSn/O6/8oF0prXvTtAWmPBrkONMXqyQe rWfQLfteU2VWLd+N5dVgPBPbjSp+KrLqPP7Fdp4zliOTEUqyPiErAEF9OrrptO9vIj/0 0t+IFqe2xOencZJN5otYQfvJxPEu3btqx4okpSu+ylQf+wS7ppacEAcq9u2OPDLPwctM 0lpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iN0znVST; 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 h3si10768634ejy.308.2021.05.10.03.57.44; Mon, 10 May 2021 03:58:08 -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=iN0znVST; 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 S234952AbhEJK5S (ORCPT + 99 others); Mon, 10 May 2021 06:57:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:58338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233101AbhEJKpG (ORCPT ); Mon, 10 May 2021 06:45:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B950D61361; Mon, 10 May 2021 10:34:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642887; bh=FttGwYaSIgG6fv2sUVh7IrDsD4nL5zQvyWLAq59Tb/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iN0znVSTWpDQQUd0GvIOe/Olvulk6EmS54lbKrwsN4hrrVrE6l/bwp3jGr6sgSiEy kNBN2hLL0/uGYmJuUeES/fml65xu8dykNOPgZeIA4ZDflURvLyFnBVc3G2Yr6w0r/s 8XpWsJuE+Rsdk30Zkp52e7ufs86W6+9LcVF7MJf8= 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 5.10 093/299] spi: omap-100k: Fix reference leak to master Date: Mon, 10 May 2021 12:18:10 +0200 Message-Id: <20210510102008.013989563@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: 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 36a4922a134a..ccd817ee4917 100644 --- a/drivers/spi/spi-omap-100k.c +++ b/drivers/spi/spi-omap-100k.c @@ -424,7 +424,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); @@ -438,7 +438,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); @@ -449,7 +449,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