@@ -885,7 +885,7 @@ static int lmd_parse_mgssec(struct lustr
length = tail - ptr;
lmd-lmd_mgssec = kzalloc(length + 1, GFP_NOFS);
- if (lmd-lmd_mgssec == NULL)
+ if (!lmd-lmd_mgssec)
return -ENOMEM;
memcpy(lmd-lmd_mgssec, ptr, length);
Am 20.06.2015 18:59, schrieb Julia Lawall:
!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
!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