Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp412964pxj; Thu, 20 May 2021 12:13:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx635I1OoOJ2KF5JHOXjvuc3TwYo45uUg/tRGRW8mXtPteuI90N/RomRC/bH312VtAVY7sy X-Received: by 2002:a17:906:2746:: with SMTP id a6mr6228014ejd.265.1621538034961; Thu, 20 May 2021 12:13:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621538034; cv=none; d=google.com; s=arc-20160816; b=IDvouzSdgT51eINzkZRDky+JyPPJtrylCiYSyWhgwxoCPY0GI1SbK6594Tu3vWNspK o+SSE2sXC2QsRXmXkpGi6IM3gab0ZF4ZwUIQsKJLmh9RgCEADDcmDTB4cltkCQCGg3WJ 9UD2jGH9egfg+Q6BtCTl7Jj7IoZaLAwrw47+tPW6QcwyOsSgoZR5kVdNVO2xU7Xg3dUN ZBdqw2qyqcMVQwEfRIZlARx0Sq3vOopC1QAZflDW5TzadMuOhAUVpDxmunuzpYH3uZ4u IeI0M0q0s4WOSDGSVsphenUNF8jxiDoWYJw1yJZaofDpGnmxuPVrK8FFlLKK+FKrMdBJ 6w0Q== 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=ExO9uecTdtqLqfYLnSaw1SAg9V1Qm6bdP0XNIaKNe8k=; b=dojDEpUL8w9UHHubFHTC1W2wymWGmOBrwcAIrw/9hyFf3iYvUpkwM0DzUlI1Nvsbtj kuC6IgAeahCdGQoECRJAaydW7HGyOl7q9NAKugaAouhZuI3Ak8WZwfUwG8wco7MR21DF LnlNtfEoURfj4TZOuVdKIeW1IxlELcdDSCmIQLgwU4WeVZnSSisbmawZmukIyfqx7uyl UIc4Y1P+owmvIOjnxbQPoycGN9wiXjsFNWvD7moSYUG1BcVHuvvx20m3h8TUCiDypS6x IxL1eD0NF/a14j6u26OJ2knSMx/owpVMeNT9qk8U7keqEH2JshJwzDkgYI+aAaO1rMWR nvAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oVKpiJxu; 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 u19si3178671edo.74.2021.05.20.12.13.31; Thu, 20 May 2021 12:13:54 -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=oVKpiJxu; 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 S236194AbhETKaC (ORCPT + 99 others); Thu, 20 May 2021 06:30:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:47740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234830AbhETKRU (ORCPT ); Thu, 20 May 2021 06:17:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A25DA619A2; Thu, 20 May 2021 09:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503981; bh=GCoE0KCXoQnp3kjoAssNrYQLQ+dFEDm9VHBfETPFS0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oVKpiJxufxFd5cxhk8cxW1xF8bEVbNFwNtSU3VErzDJ/ov8RiS09IzScI0ke7SnvD ozEG8aUzqssYlHQqEHTbDBcE1N+8Hs3y9eR21dtr1lDUJW9lsXEFLoZc4pOUaTjnrI eRuzbJs5Oo+x50eNZfudQDJLD+aDwC9yktU7/Cqs= 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 040/323] spi: dln2: Fix reference leak to master Date: Thu, 20 May 2021 11:18:52 +0200 Message-Id: <20210520092121.482469716@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 9b844b087124c1538d05f40fda8a4fec75af55be ] 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/20210409082955.2907950-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-dln2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-dln2.c b/drivers/spi/spi-dln2.c index b62a99caacc0..a41adea48618 100644 --- a/drivers/spi/spi-dln2.c +++ b/drivers/spi/spi-dln2.c @@ -783,7 +783,7 @@ exit_free_master: static int dln2_spi_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 dln2_spi *dln2 = spi_master_get_devdata(master); pm_runtime_disable(&pdev->dev); -- 2.30.2