Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3758496pxt; Tue, 10 Aug 2021 10:38:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybBJa+vhFdgcZtpRltSIhkhkfqwc0hH6qgPe47hIS+Ns91xv+WpRF3X7VDUBLSrvbjf2iX X-Received: by 2002:a50:cd4e:: with SMTP id d14mr2570574edj.384.1628617085984; Tue, 10 Aug 2021 10:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617085; cv=none; d=google.com; s=arc-20160816; b=lmQUBTihTKRVmNiBhh3m7V7GwZyyQXzc3dUrW4qcusJypkbP94NGZAl7HV/PdrA2zu Wiwa95fojpkcWg/nJS7Yj68J3N7mYVJxAJ2m0VGiBJVSCEupqPc8k5DFKqPL3aMRT8JF h8eMbefzMIIqWzK93+Qh2yd//BgTc9GKGclKkAYa56buy3TOqwTedeVScjfQ+EgjZCpq tt6trurfPMvhyWqQoUCuTmQfVRn0TMfBqjI6pQLfR8p9SRhzT3lemnRo8rMLEQnKJvjm YYU08E7IIYqMIhsXNFl+h25Z1qEnzkWvIwdnGWjo9VSF/zwOG7FmT3Z2rKyWG9YN0b2W aoGg== 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=jk626CTSeCbwRpPJGlzEITb+hZLVSrzZS9ki4dUwXzc=; b=ANT2wnCen8FXz9dalUXM7fRDKo4njArZ6jcCvb9LhfJfN3DgoTX9+e1lzT7+Yi5UoS BgpvtF2TSqQjIO0sqLuM+eBNIaH8SXsan7Ibq6ERBtSAUidGiZSZm7H+tst0aCjsrKv1 40Agf6LtTtnXgTcZhOuKiKgHxr2+wX76h4Rkdxf5V/CYtOqIIJ8rRJnLjnqPhiVwMnWu p3wPb7yxdRtyVKJAfK9zfiFfhpStfC8se8zYJUfZXdgAtY9zb2pnxvpYMlv0FDUC9stc K+zKwVZ5xrcyfFVFjVxVRGBYT/VVWzdFIsoVfUmJl3HA8rs47csncN1z4mdhCUaOOrz5 bV3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BrbeVPaX; 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 p5si21002841edt.311.2021.08.10.10.37.42; Tue, 10 Aug 2021 10:38:05 -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=BrbeVPaX; 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 S232622AbhHJRen (ORCPT + 99 others); Tue, 10 Aug 2021 13:34:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:37848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232834AbhHJRdy (ORCPT ); Tue, 10 Aug 2021 13:33:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4C50C60F41; Tue, 10 Aug 2021 17:33:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628616811; bh=i2zCazZeP+sT2YQiWWWFNaOJ/n/UKH3EC44jbWO8rzQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BrbeVPaXApcDKnpGMqnMBvWcjRXbJw3jqsmT9IiOBn9sbVxO4muU7P5KUMiWNS8AT WAcGw7a+20LksBQ6Gafi6zRoXDNE0QfWGX3vSzKsb5VUhVJSAMYs9Mo2y+dMloTqVx fVKJu0gHv305dKEXG4xt8PlLOtURaehyQU9wYbzk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dongliang Mu , Mark Brown Subject: [PATCH 4.19 46/54] spi: meson-spicc: fix memory leak in meson_spicc_remove Date: Tue, 10 Aug 2021 19:30:40 +0200 Message-Id: <20210810172945.712251303@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172944.179901509@linuxfoundation.org> References: <20210810172944.179901509@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 @@ -599,6 +599,8 @@ static int meson_spicc_remove(struct pla clk_disable_unprepare(spicc->core); + spi_master_put(spicc->master); + return 0; }