Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3762351pxt; Tue, 10 Aug 2021 10:43:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpztqlK6K4fxUYXFe+lpFXiwrPHT6QmhgRJCjCxfDnVpgmg3tUeZDW5iyQbA+2ecI32mLb X-Received: by 2002:a17:907:2595:: with SMTP id ad21mr27834126ejc.430.1628617432497; Tue, 10 Aug 2021 10:43:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617432; cv=none; d=google.com; s=arc-20160816; b=fToiJ/CP87V8u7Z0hGFBrLeHS6gGVXfDc7mEpC8ZLGNzww0/mzK9t+CmsACRAZwI+O ZB1xaisibY+RSS+lsK05ucN4p/GcQ7Pda70RaTbqPqQTU+C7jPqLX2L4TP6q5c+ZmLle C56oFQtm6w0N9Q2tKr0v/zeat279UnqLnnzwgleQUhmgGPPegB0YdZZkCgRhH7XRYnu3 hs7wcaXLrNBjKJ29ftCORZwM3wPjXwSwozucjpqLZDbqdYSVFnyBeRigo7PirDpWgvvW kNL3xBWFxKNUKaXDBwML6MJw2ZroP5TzG2ir+mFm3Fb+Wa0jWoNNoO2HZxxm38M02+fl yH1w== 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=9Y8VD5sgBLbO641Iw/mr4hFdGf9Z2ZkNA/u+BLaIuJo=; b=wwdJOHC33Z8DhMB5LeLkfBMEgypaX0qdBXjjLFYMpPVyyqIKEl1xbVv8xua9wjWn8o CmFmaPQvDexslFdaic503BnCA8L3v2Jy61WbtANNgfK+d7Vj3ZSpV255P4kB4soMhhU2 ozkWpjRhE9RpJnPwGOuWdAmT0a4atEpFlOaQbuje3TMYxXc8otXjz/jun3fEavyf/+4I j6E+IpOyydpel6dO42OooSD8ZHOiOIdlDWV4ADJJE9lfGKcCgAD6kYFeamk1qaNdk5jI NGG9xrycBCyb6M/dte/9Ut3h5uqI/ATRyHo0dNP9ACzLdsKXcOoarCWWkDsycMl3BDrl CpIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1yX0LmLJ; 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 y59si7651838ede.530.2021.08.10.10.43.25; Tue, 10 Aug 2021 10:43:52 -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=1yX0LmLJ; 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 S235691AbhHJRkE (ORCPT + 99 others); Tue, 10 Aug 2021 13:40:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:43594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233287AbhHJRhp (ORCPT ); Tue, 10 Aug 2021 13:37:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1202E61051; Tue, 10 Aug 2021 17:36:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628616975; bh=aUQN+ps0+WrA92b8jdBM+CXbpGx5aOvw2PA2MQT661k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1yX0LmLJ6PSTFrOUT4KqF9eGMmo/cdkfQNKwWafcf3MD0BW6+ZX1pE47eDUHwQ0lz oxwvp9h7ZHuk0pEMt40OLynu/eLVHKbKSygSdLyXMc+A8WLxdxjcBPBiQ/XUMnX64Z TI8AbmjSGrVRQdqq6kkAXgXuUYU9RJr3hFdlaFsU= 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.4 75/85] spi: meson-spicc: fix memory leak in meson_spicc_remove Date: Tue, 10 Aug 2021 19:30:48 +0200 Message-Id: <20210810172950.772393521@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172948.192298392@linuxfoundation.org> References: <20210810172948.192298392@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 @@ -597,6 +597,8 @@ static int meson_spicc_remove(struct pla clk_disable_unprepare(spicc->core); + spi_master_put(spicc->master); + return 0; }