lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230427183833.GA263506@bhelgaas>
Date:   Thu, 27 Apr 2023 13:38:33 -0500
From:   Bjorn Helgaas <helgaas@...nel.org>
To:     Junyan Ye <yejunyan@...t.edu.cn>
Cc:     christophe.jaillet@...adoo.fr,
        Lorenzo Pieralisi <lpieralisi@...nel.org>,
        Krzysztof WilczyƄski <kw@...ux.com>,
        Rob Herring <robh@...nel.org>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Wei Yongjun <weiyongjun1@...wei.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Andrew Murray <amurray@...goodpenguin.co.uk>,
        hust-os-kernel-patches@...glegroups.com,
        Dongliang Mu <dzm91@...t.edu.cn>, linux-pci@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] pci: controller: pci-ftpci100: Release the clock
 resources

On Sun, Apr 23, 2023 at 01:32:07PM +0800, Junyan Ye wrote:
> Smatch reported:
> 1. drivers/pci/controller/pci-ftpci100.c:526 faraday_pci_probe()
> warn: 'clk' from clk_prepare_enable() not released on lines:
> 442,451,462,478,512,517.
> 2. drivers/pci/controller/pci-ftpci100.c:526 faraday_pci_probe()
> warn: 'p->bus_clk' from clk_prepare_enable() not released on lines:
> 451,462,478,512,517.

If/when you repost this, please:

  - Rebase to v6.4-rc1 (when it's available).

  - Look at subject line history for this file and match it.

  - Include the smatch warnings exactly above (not wrapped to fit in
    75 columns).  This is to make it easier to search for the text.

  - Add "()" after function names below to make it obvious they are
    functions.  You can also omit "function", e.g., "... is obtained
    by devm_clk_get()."

> The clock resource is obtained by the devm_clk_get function. The
> clk_prepare_enable function then makes the clock resource ready for use,
> notifying the system that the clock resource should be run. After that,
> the clock resource should be released when it is no longer needed. The
> corresponding function is clk_disable_unprepare. However, while doing
> some error handling in the faraday_pci_probe function, the
> clk_disable_unprepare function is not called to release the clk and
> p->bus_clk resources.

I don't know the clk terminology.  Does "... clock resource should be
run" mean the clock should be "running" or "enabled"?
include/linux/clk.h only uses "running" twice but has many instances
of "enable", so maybe that would be better.  Or maybe it's enough to
say:

  clk_prepare_enable() then makes the clock resource ready for use.

and omit the rest of that sentence?

Looks like a nice fix, thank you!

Bjorn

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ