[PATCH 5] Fix error handling with malloc, memalign etc. Memalign() can't fail now.

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Tue Dec 21 19:58:29 EST 2010


  
> diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
> index 717fea5..9d52beb 100644
> --- a/drivers/clk/clkdev.c
> +++ b/drivers/clk/clkdev.c
please do not modify it I want to keep it as in the kernel
> @@ -116,9 +116,7 @@ struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
>  {
>  	struct clk_lookup_alloc *cla;
>  
> -	cla = kzalloc(sizeof(*cla), GFP_KERNEL);
> -	if (!cla)
> -		return NULL;
> +	cla = xzalloc(sizeof(*cla), GFP_KERNEL);
>  
>  	cla->cl.clk = clk;
>  	if (con_id) {
> @@ -150,8 +148,6 @@ int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
>  
>  	l = clkdev_alloc(r, alias, alias_dev_name);
>  	clk_put(r);
> -	if (!l)
> -		return -ENODEV;
>  	clkdev_add(l);
>  	return 0;
>  }

Best Regards,
J.



More information about the barebox mailing list