Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9113624pxu; Mon, 28 Dec 2020 07:00:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJycwkyxiYWE8h5SZaC6OWytgi8d+HvHz/crlmaQpj3fghWj2TxGYU5EduvUjJbeCd2TuWAT X-Received: by 2002:a17:906:1a5a:: with SMTP id j26mr42185852ejf.225.1609167651430; Mon, 28 Dec 2020 07:00:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609167651; cv=none; d=google.com; s=arc-20160816; b=wGDkqIPSaoM6uwo4JaBKolk8yBrhUQk9DwviHfB3j/IedJvvm+809+NSPyJ1QgkJk2 phTawwwlDkYw9IBPCxK4n8opeWtwNKPSlcPwhe8vdJQX0QeV8GgZ5PZcV3t8ogIZLhCZ xjtmPI3EW7eTx0FG9TMXrKkupmvlhVvRVdXY6gtQrNMDv2wHbGWfRHumGKWGW0hoWzB1 /dDGFFmdb+SjYoTelV3aYMcJnoliRlE//hfqPP+vR99hZ3+Y8ePD5AMDYtWxWUeMdEZn uQONQPKJRakFayZm2VsmBaRzfLiJF1me2Bxmd25Qy3BRrv5av3zl0tt2kzcTGc1JZ1AQ gf1g== 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=t5VA9lp5/V9AAgRty+MUkrqNufvyrRX6t5xP2OhNvlQ=; b=CrGqT76qDlrRfsuTYgGbWMyJK+wSYyaCrUDE0Dy6iQiSl9DjodA3XVDjqwj8I9XQKz wDrBF6VTgwK+FsxuqygrhyKisSPwKd7Crr4GDLhWQt7X8FPlo+SXyBb2/jg8rVlZzHvW Ly63OceaKdtz+LkVBReB5jJl5Thb9ZYkVg9+ooKzMVmhs5At+QBg3Ke9hVj3lnjXYX0o 1PjjfOqsgdbKWocYJ3sMqFY1Pt6Xt1gTCi5pVDy1VlTp3wYadfystkeuoE7dMK8r8i5T OWHlB64wHfl8FzYgAhg5glAC0tXXxsniqGricSSEFVDR8yYrkk2EmD8q0TzhJMKMwK9S kDwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FMZVvYFn; 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 v13si19828776edx.218.2020.12.28.07.00.27; Mon, 28 Dec 2020 07:00:51 -0800 (PST) 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=FMZVvYFn; 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 S2504220AbgL1O5E (ORCPT + 99 others); Mon, 28 Dec 2020 09:57:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:51548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391774AbgL1OQY (ORCPT ); Mon, 28 Dec 2020 09:16:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B77A220731; Mon, 28 Dec 2020 14:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164944; bh=LgldpMDVU4q8dllax2srGkExxRoqlemJ1a2XzNMXvZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FMZVvYFnRNcMJtjC/ckovdL4pTkURF1LRqLVll2P1n7fGVy5uQcvLOwXDsSrwUUr5 4/rEoSq9JMX+5TO5obKW36CIiZcjnbUrh3Kduycq7HuJ7x1yl3tc/at+HZZlEF2SuE DJXQwSgPnoN55HzJRgns1hBbYfft+3MbJab9w7uk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Walle , Stephen Boyd , Sasha Levin Subject: [PATCH 5.10 355/717] clk: fsl-sai: fix memory leak Date: Mon, 28 Dec 2020 13:45:53 +0100 Message-Id: <20201228125038.028369564@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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: Michael Walle [ Upstream commit e81bed419f032824e7ddf8b5630153be6637e480 ] If the device is removed we don't unregister the composite clock. Fix that. Fixes: 9cd10205227c ("clk: fsl-sai: new driver") Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20201105192746.19564-2-michael@walle.cc Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/clk-fsl-sai.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/clk/clk-fsl-sai.c b/drivers/clk/clk-fsl-sai.c index 0221180a4dd73..1e81c8d8a6fd3 100644 --- a/drivers/clk/clk-fsl-sai.c +++ b/drivers/clk/clk-fsl-sai.c @@ -68,9 +68,20 @@ static int fsl_sai_clk_probe(struct platform_device *pdev) if (IS_ERR(hw)) return PTR_ERR(hw); + platform_set_drvdata(pdev, hw); + return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, hw); } +static int fsl_sai_clk_remove(struct platform_device *pdev) +{ + struct clk_hw *hw = platform_get_drvdata(pdev); + + clk_hw_unregister_composite(hw); + + return 0; +} + static const struct of_device_id of_fsl_sai_clk_ids[] = { { .compatible = "fsl,vf610-sai-clock" }, { } @@ -79,6 +90,7 @@ MODULE_DEVICE_TABLE(of, of_fsl_sai_clk_ids); static struct platform_driver fsl_sai_clk_driver = { .probe = fsl_sai_clk_probe, + .remove = fsl_sai_clk_remove, .driver = { .name = "fsl-sai-clk", .of_match_table = of_fsl_sai_clk_ids, -- 2.27.0