lkml.org 
[lkml]   [2012]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/5] mfd: tps65090: add error prints when mem alloc failed
From
Date
On Sun, 2012-10-07 at 20:52 +0530, Laxman Dewangan wrote:
> Add error prints when memory allocation failed for
> tps65090 data. Also cleanups the melloc arguments.

The new dev_err is unnecessary.
A dump_stack is already done on alloc failures.
The sizeof(* is ok.


> diff --git a/drivers/mfd/tps65090.c b/drivers/mfd/tps65090.c
[]
> @@ -263,10 +263,11 @@ static int __devinit tps65090_i2c_probe(struct i2c_client *client,
> return -EINVAL;
> }
>
> - tps65090 = devm_kzalloc(&client->dev, sizeof(struct tps65090),
> - GFP_KERNEL);
> - if (tps65090 == NULL)
> + tps65090 = devm_kzalloc(&client->dev, sizeof(*tps65090), GFP_KERNEL);
> + if (!tps65090) {
> + dev_err(&client->dev, "mem alloc for tps65090 failed\n");
> return -ENOMEM;
> + }





\
 
 \ /
  Last update: 2012-10-07 18:41    [W:0.073 / U:3.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site