staging: lustre: fid: 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>
This commit is contained in:
Julia Lawall 2015-06-20 18:58:59 +02:00 committed by Greg Kroah-Hartman
parent 6fdb302c1d
commit 6c7c655386
1 changed files with 2 additions and 2 deletions

View File

@ -498,11 +498,11 @@ int client_fid_init(struct obd_device *obd,
int rc;
cli->cl_seq = kzalloc(sizeof(*cli->cl_seq), GFP_NOFS);
if (cli->cl_seq == NULL)
if (!cli->cl_seq)
return -ENOMEM;
prefix = kzalloc(MAX_OBD_NAME + 5, GFP_NOFS);
if (prefix == NULL) {
if (!prefix) {
rc = -ENOMEM;
goto out_free_seq;
}