Re: [PATCH v11 01/27] clk: davinci: pll: allow dev == NULL
From: Sekhar Nori
Date: Tue May 22 2018 - 03:50:45 EST
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@xxxxxx>
Thanks,
Sekhar