Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3767987pxt; Tue, 10 Aug 2021 10:52:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/Kh53dfgYEhS6bHLXLiVnUP+uwwtiSq4nKGsan9nps+TpHQxUcx+Li06Or8rqiObt7Uq0 X-Received: by 2002:a92:d04:: with SMTP id 4mr3969iln.280.1628617931126; Tue, 10 Aug 2021 10:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617931; cv=none; d=google.com; s=arc-20160816; b=vdk8Sx+CC1uSAMOhGI36XREOCOqdKB6IIpdN7THLGFYEMMIC03kv6JRVzX0wbku50h +LSYRjGfhkyc326L1uJWIOGVHYwelW1G49P9wmyut6ChscPSHkjhKeCJUgSvtz2YR4rD uUZX1Gs+I4J8saXnuVj885Gogj/ddPmApwr0OidL0CbvbfDEJh4JuKjJqGe3oZZk/abC ZoBDP6Vi8IYGJTd5oD2IYkum0agzLLoSqkzipAuFL93m8PyLorBJ3HeA5PxDd3WE+rat h+XPY/DhFtqw8rxvEfBGwQqISy9od2em1nVUVfYXJtJazVTIWOTGoDlPwY2iUSWx8YvG wkEw== 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=8rb6mG6B1Y7TxbEy+LPTloQUmBB6QI3v7C7+NmMQfpw=; b=BZr5gm2oLuI/wLcSqIKdC1Mv61g7y8nFTpKN8nOT66R/0SusSICCU/pDc5fPgHuXOL 14ijtkbDAeHCxNNW2GFNbwVnVNkHKCkpvGgG46nSZLS3dGP9EEtm+owMJ14fSRkEHXry OAbjHAHiPKarBwOU7TnvWSuI1+ayAGv/dQxCuO09CkjVBzgEwedMJ4ebBVXUZruNGuk9 xWJ983oUN/G3yeE/ZDYymA5vZ44ynfEbniMSFY5HrPunurzle0WAI6lch7ppBGgnMVux sl+/+8hAXOnkjEwohtqUapx0/KpaH8dg1qPTG49KmYFhacSd5GoNLHdXuxZhQIh2krdr bEzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=alcGB6UV; 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 d131si32788481iog.11.2021.08.10.10.51.59; Tue, 10 Aug 2021 10:52:11 -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=alcGB6UV; 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 S236119AbhHJRvg (ORCPT + 99 others); Tue, 10 Aug 2021 13:51:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:55284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234555AbhHJRrZ (ORCPT ); Tue, 10 Aug 2021 13:47:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5F8AA6023E; Tue, 10 Aug 2021 17:40:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628617258; bh=HPpoJHqEyQFFQr1mBXEm3NQEDkewRfD81StpTolw5KU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=alcGB6UVtGXCEyxHhb3t4ckKj2FdSRfJh7CaIaqZmgTRup7GRRy64JCv4Sz3itnbE OFhiemf9NzTZ13b9rHQP/eCLs1VF+un6imG5QA56OWh62Q6ZzNN7cubcfgwwepRSO4 DoaFdjz2z00jNMocLeIzJexM06uV0B/tjyb/Y1V4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dongliang Mu , Mark Brown Subject: [PATCH 5.10 116/135] spi: meson-spicc: fix memory leak in meson_spicc_remove Date: Tue, 10 Aug 2021 19:30:50 +0200 Message-Id: <20210810172959.734172948@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172955.660225700@linuxfoundation.org> References: <20210810172955.660225700@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: Dongliang Mu commit 8311ee2164c5cd1b63a601ea366f540eae89f10e upstream. In meson_spicc_probe, the error handling code needs to clean up master by calling spi_master_put, but the remove function does not have this function call. This will lead to memory leak of spicc->master. Reported-by: Dongliang Mu Fixes: 454fa271bc4e("spi: Add Meson SPICC driver") Signed-off-by: Dongliang Mu Link: https://lore.kernel.org/r/20210720100116.1438974-1-mudongliangabcd@gmail.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-meson-spicc.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/spi/spi-meson-spicc.c +++ b/drivers/spi/spi-meson-spicc.c @@ -785,6 +785,8 @@ static int meson_spicc_remove(struct pla clk_disable_unprepare(spicc->core); clk_disable_unprepare(spicc->pclk); + spi_master_put(spicc->master); + return 0; }