UBIFS: use an IS_ERR test rather than a NULL test
authorJulien Brunel <brunel@diku.dk>
Fri, 29 Aug 2008 09:08:32 +0000 (11:08 +0200)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Sat, 25 Oct 2008 15:47:34 +0000 (18:47 +0300)
In case of error, the function kthread_create returns an ERR pointer,
but never returns a NULL pointer. So a NULL test that comes before an
IS_ERR test should be deleted.

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@match_bad_null_test@
expression x, E;
statement S1,S2;
@@
x = kthread_create(...)
... when != x = E
* if (x == NULL)
S1 else S2
// </smpl>

Signed-off-by: Julien Brunel <brunel@diku.dk>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

No differences found