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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c0afdf9f8c9773ef83274cb119d14c90.sboyd@kernel.org>
Date: Fri, 18 Oct 2024 22:56:28 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: Alim Akhtar <alim.akhtar@...sung.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>, Bjorn Helgaas <bhelgaas@...gle.com>, Cristian Ciocaltea <cristian.ciocaltea@...labora.com>, Jingoo Han <jingoohan1@...il.com>, Krzysztof Kozlowski <krzk@...nel.org>, Krzysztof WilczyƄski <kw@...ux.com>, Lorenzo Pieralisi <lpieralisi@...nel.org>, Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>, Matthias Brugger <matthias.bgg@...il.com>, Michael Turquette <mturquette@...libre.com>, Rob Herring <robh@...nel.org>, Russell King <linux@...linux.org.uk>
Cc: kernel@...labora.com, linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, linux-mediatek@...ts.infradead.org, linux-pci@...r.kernel.org, linux-samsung-soc@...r.kernel.org
Subject: Re: [PATCH v3 1/4] clk: Provide devm_clk_bulk_get_all_enabled() helper

Quoting Cristian Ciocaltea (2024-10-17 16:17:29)
> diff --git a/drivers/clk/clk-devres.c b/drivers/clk/clk-devres.c
> index 82ae1f26e634572b943d18b8d86267f0a69911a6..0d0fe364b66a8590d5e7c63dc6c1e70c59d53e89 100644
> --- a/drivers/clk/clk-devres.c
> +++ b/drivers/clk/clk-devres.c
> @@ -230,25 +239,27 @@ int __must_check devm_clk_bulk_get_all_enable(struct device *dev,
>                 return -ENOMEM;
>  
>         ret = clk_bulk_get_all(dev, &devres->clks);
> -       if (ret > 0) {
> -               *clks = devres->clks;
> -               devres->num_clks = ret;
> -       } else {
> -               devres_free(devres);
> -               return ret;
> -       }
> +       if (ret <= 0)
> +               goto err_free_devres;

Please don't use goto so that the diff is minimized.

> +
> +       *clks = devres->clks;
> +       devres->num_clks = ret;
>  
>         ret = clk_bulk_prepare_enable(devres->num_clks, *clks);
> -       if (!ret) {
> -               devres_add(dev, devres);
> -       } else {
> +       if (ret) {
>                 clk_bulk_put_all(devres->num_clks, devres->clks);
> -               devres_free(devres);
> +               goto err_free_devres;

		return ret;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ