summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/osc/osc_dev.c
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2015-06-20 18:59:09 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-07-13 19:35:53 -0700
commit3408e9aeee5fedd0eab223502074cad3120324b0 (patch)
tree8291f5d9ada75d2d6cd9b95f8ca274a3c8be7e0f /drivers/staging/lustre/lustre/osc/osc_dev.c
parentefeb257dcf1c84fa05eff06cb829906576ae21b8 (diff)
downloadop-kernel-dev-3408e9aeee5fedd0eab223502074cad3120324b0.zip
op-kernel-dev-3408e9aeee5fedd0eab223502074cad3120324b0.tar.gz
staging: lustre: osc: Use !x to check for kzalloc failure
!x is more normal for kzalloc failure in the kernel. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x; statement S1, S2; @@ x = kzalloc(...); if ( - x == NULL + !x ) S1 else S2 // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/osc/osc_dev.c')
-rw-r--r--drivers/staging/lustre/lustre/osc/osc_dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/osc/osc_dev.c b/drivers/staging/lustre/lustre/osc/osc_dev.c
index 9222c9f..91fdec4 100644
--- a/drivers/staging/lustre/lustre/osc/osc_dev.c
+++ b/drivers/staging/lustre/lustre/osc/osc_dev.c
@@ -218,7 +218,7 @@ static struct lu_device *osc_device_alloc(const struct lu_env *env,
int rc;
od = kzalloc(sizeof(*od), GFP_NOFS);
- if (od == NULL)
+ if (!od)
return ERR_PTR(-ENOMEM);
cl_device_init(&od->od_cl, t);
OpenPOWER on IntegriCloud