diff options
author | Aishwarya Pant <aishpant@gmail.com> | 2017-10-17 09:14:47 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-10-31 06:06:43 -0400 |
commit | 309167b966b61c2aef2c268c4a0c25334d6310bd (patch) | |
tree | 720666597aa421f9a87776cb005e9dbafa9ba894 /drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c | |
parent | eab638a8ae6e874a226e61b57e35032ee461e0bf (diff) |
media: staging: atomisp: cleanup out of memory messages
Logging of explicit out of memory messages is redundant since memory allocation
failures produce a backtrace.
Done with the help of the following cocci script:
@@
expression ex, ret;
statement s;
constant char[] c;
constant err;
identifier f, l;
@@
ex =
\(kmalloc\|kmalloc_array\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\|
kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|devm_kzalloc\)(...)
... when != ex
if (
(
!ex
|
unlikely(!ex)
)
)
- {
- f(..., c, ...);
(
return ex;
|
return;
|
return err;
|
goto l;
)
- }
else s
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c')
-rw-r--r-- | drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c index 8a20a28d37f1..8c6a26eea095 100644 --- a/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c +++ b/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c @@ -785,10 +785,8 @@ int camera_sensor_csi(struct v4l2_subdev *sd, u32 port, if (flag) { csi = kzalloc(sizeof(*csi), GFP_KERNEL); - if (!csi) { - dev_err(&client->dev, "out of memory\n"); + if (!csi) return -ENOMEM; - } csi->port = port; csi->num_lanes = lanes; csi->input_format = format; |