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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJKOXPd=E+S3j3XnpCVRs3JdStY2z+pHe0bh_HNzQTmJW_dH=Q@mail.gmail.com>
Date:   Fri, 2 Nov 2018 09:15:17 +0100
From:   Krzysztof Kozlowski <krzk@...nel.org>
To:     matti.vaittinen@...rohmeurope.com
Cc:     corbet@....net, mturquette@...libre.com, sboyd@...nel.org,
        Chanwoo Choi <cw00.choi@...sung.com>,
        Bartłomiej Żołnierkiewicz 
        <b.zolnierkie@...sung.com>, linux@...linux.org.uk,
        andy.gross@...aro.org, david.brown@...aro.org, kgene@...nel.org,
        s.nawrocki@...sung.com, Tomasz Figa <tomasz.figa@...il.com>,
        andrew.smirnov@...il.com, sre@...nel.org, linux@...ck-us.net,
        robh@...nel.org, sjhuang@...vatar.ai, Akshu.Agrawal@....com,
        rafael.j.wysocki@...el.com, djkurtz@...omium.org,
        mazziesaccount@...il.com, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-clk@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-arm-msm@...r.kernel.org, linux-soc@...r.kernel.org,
        "linux-samsung-soc@...r.kernel.org" 
        <linux-samsung-soc@...r.kernel.org>
Subject: Re: [PATCH v2 2/8] clk: clk-max77686: Clean clkdev lookup leak and
 use devm

On Thu, 1 Nov 2018 at 08:19, Matti Vaittinen
<matti.vaittinen@...rohmeurope.com> wrote:
>
> clk-max77686 never clean clkdev lookup at remove. This can cause
> oops if clk-max77686 is removed and inserted again. Fix leak by
> using new devm clkdev lookup registration. Simplify also error
> path by using new devm_of_clk_add_parent_hw_provider.
>
> Signed-off-by: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
> ---
>  drivers/clk/clk-max77686.c | 25 ++++---------------------
>  1 file changed, 4 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/clk/clk-max77686.c b/drivers/clk/clk-max77686.c
> index 02551fe4b87c..b1920c1d9b76 100644
> --- a/drivers/clk/clk-max77686.c
> +++ b/drivers/clk/clk-max77686.c
> @@ -235,7 +235,7 @@ static int max77686_clk_probe(struct platform_device *pdev)
>                         return ret;
>                 }
>
> -               ret = clk_hw_register_clkdev(&max_clk_data->hw,
> +               ret = devm_clk_hw_register_clkdev(dev, &max_clk_data->hw,
>                                              max_clk_data->clk_idata.name, NULL);

You need to re-align the next line.

>                 if (ret < 0) {
>                         dev_err(dev, "Failed to clkdev register: %d\n", ret);
> @@ -244,8 +244,8 @@ static int max77686_clk_probe(struct platform_device *pdev)
>         }
>
>         if (parent->of_node) {
> -               ret = of_clk_add_hw_provider(parent->of_node, of_clk_max77686_get,
> -                                            drv_data);
> +               ret = devm_of_clk_add_parent_hw_provider(dev,
> +                                               of_clk_max77686_get, drv_data);

The same, please.

Rest looks good, so with these changes:
Reviewed-by: Krzysztof Kozlowski <krzk@...nel.org>

Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ