lkml.org 
[lkml]   [2018]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 4/4] clk: pmc-atom: use devm_kstrdup_const()
On Mon, Sep 24, 2018 at 12:11:50PM +0200, Bartosz Golaszewski wrote:
> Use devm_kstrdup_const() in the pmc-atom driver. This mostly serves as
> an example of how to use this new routine to shrink driver code.
>
> While we're at it: replace a call to kcalloc() with devm_kcalloc().

> @@ -352,8 +344,6 @@ static int plt_clk_probe(struct platform_device *pdev)
> goto err_drop_mclk;
> }
>
> - plt_clk_free_parent_names_loop(parent_names, data->nparents);
> -
> platform_set_drvdata(pdev, data);
> return 0;

I don't think this is a good example.

You changed a behaviour here in the way that you keep all chunks of memory
(even small enough for pointers) during entire life time of the driver, which
pretty likely would be forever till next boot.

In the original case the memory was freed immediately in probe either it fails
or returns with success.

NAK, sorry.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2018-09-24 13:23    [W:0.098 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site