Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2476170pxj; Mon, 10 May 2021 04:02:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDmtlHoqqUdljg86MgfbaeAuV8+E947GsCeofEV+5r37lRhHScXMn9YONGl1HTjSkLNs5Q X-Received: by 2002:aa7:c382:: with SMTP id k2mr29286960edq.189.1620644555781; Mon, 10 May 2021 04:02:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620644555; cv=none; d=google.com; s=arc-20160816; b=y6FnU52G5b2ek7egxq7UkgiHBrapkUsDNXNHZCsLWimXcbqRBWb78lIstLPHbc1FbM +Y7brycvwBZ227XgloQgvAgoJnVNmOgsa4T5hjDKIQRsMxSZPsmM0P6ZtG6xldzC/e5o AoZj9W/O4HmmXu2iHpfWQ4yvlCIa3n1lYkvG7H/sEM2tQU/RK0mBEhjdbeXeA63UG+El o4juDZYnKf67EOn8hkpergc5DM5he5IydMawUstABcfMTEaRZhkpHan7iWL21kZ/Stwf 8M96gm0vSZ+sMZB1QZDkgCI3bpxk6+zsiqzPc4k+CFQUP+LwaVP5BCOUzfBtC7dYcaYJ JOkw== 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=eZvoYePCcNcb/eDjRPmeuytGL920yPoyeeegoPjcps4=; b=QzMPOgXWix5ESz+FYFB7EjdlK0yaUndqxv3xcUT3l8tJWue87+xtgscErLQndo7KM+ Snr7ZbHrf8fqWfsHwuK1vhxEVrb2O8IiIUZgSLqY77LeZFbUAjpg3TAKFQL0bkJ3hfo5 JYi4aWHV9pBndAHjnPcEfiOJ1JyNHlEp5PjwKq4AN3KnkcWDKEDvqi98wgBfoSvYrLP2 l5f5IfNowhDaGwxnbSeqzOufv1hqFbYL5RdEYkPU8TuHce1cR55Vl5f/brh7SNqWNPbj Mo+Y0+p8yUvFBUF7dG0Qzt/BgnOxBPrV8/t3Apn8ZC0GsFIAKhOoeMxcXscG+9leWDzD tkHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XVD1zsO+; 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 v28si1882790edx.407.2021.05.10.04.02.09; Mon, 10 May 2021 04:02:35 -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=XVD1zsO+; 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 S234985AbhEJK5V (ORCPT + 99 others); Mon, 10 May 2021 06:57:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:58292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233097AbhEJKpG (ORCPT ); Mon, 10 May 2021 06:45:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5723E6198D; Mon, 10 May 2021 10:34:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642884; bh=C2H65WP07QgvE+W6suGNJ0L+SwhbQURawXPM8DVvPM0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XVD1zsO+AqiBKpVrOojdNq2xozYfTaahSXWi8gI+HMxlpa3cGoN8z+vu+UFxjmCeT T79JcpECySANEc24zCX6UB9l8UnQqRJ95OrnvZLjCCnIOukJ6eZS1HN64R6EDwqqY7 vRC9pasqDiESweB05lY1pYpI8GSWHJJQc16FYNx8= 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 092/299] spi: dln2: Fix reference leak to master Date: Mon, 10 May 2021 12:18:09 +0200 Message-Id: <20210510102007.984328221@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 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 75b33d7d14b0..9a4d942fafcf 100644 --- a/drivers/spi/spi-dln2.c +++ b/drivers/spi/spi-dln2.c @@ -780,7 +780,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