Re: [PATCH v2 2/3] clk: mvebu: dynamically allocate resources in Armada CP110 system controller

From: Baruch Siach
Date: Tue Sep 06 2016 - 14:00:09 EST


Hi Marcin,

On Tue, Sep 06, 2016 at 07:31:56PM +0200, Marcin Wojtas wrote:
> + cp110_clks = devm_kcalloc(&pdev->dev, sizeof(struct clk *),
> + CP110_CLK_NUM, GFP_KERNEL);
> + if (!cp110_clks)
> + return PTR_ERR(cp110_clks);

PTR_ERR(NULL) translates to 0. Should probably just return -ENOMEM.

> + cp110_clk_data = devm_kzalloc(&pdev->dev,
> + sizeof(*cp110_clk_data),
> + GFP_KERNEL);
> + if (!cp110_clk_data)
> + return PTR_ERR(cp110_clk_data);

Ditto.

baruch

--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch@xxxxxxxxxx - tel: +972.52.368.4656, http://www.tkos.co.il -