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

Baruch Siach baruch at tkos.co.il
Tue Sep 6 10:59:51 PDT 2016


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 at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -



More information about the linux-arm-kernel mailing list