lkml.org 
[lkml]   [2018]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v11 01/27] clk: davinci: pll: allow dev == NULL
From
Date
On Friday 18 May 2018 10:18 PM, David Lechner wrote:
> @@ -711,11 +777,11 @@ int of_davinci_pll_init(struct device *dev,
> int n_clks = max_sysclk_id + 1;
> int i;
>
> - clk_data = devm_kzalloc(dev, sizeof(*clk_data), GFP_KERNEL);
> + clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL);
> if (!clk_data)
> return -ENOMEM;
>
> - clks = devm_kmalloc_array(dev, n_clks, sizeof(*clks), GFP_KERNEL);
> + clks = kmalloc_array(n_clks, sizeof(*clks), GFP_KERNEL);
> if (!clks)
> return -ENOMEM;

This should be:

if (!clks) {
kfree(clk_data);
return -ENOMEM;
}

With that fixed:

Reviewed-by: Sekhar Nori <nsekhar@ti.com>

Thanks,
Sekhar

\
 
 \ /
  Last update: 2018-05-22 10:46    [W:0.115 / U:5.396 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site