]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
RDMA/ucma: Test ucma_alloc_multicast() return against NULL, not with IS_ERR()
authorJulien Brunel <brunel@diku.dk>
Fri, 10 Oct 2008 19:00:19 +0000 (12:00 -0700)
committerRoland Dreier <rolandd@cisco.com>
Fri, 10 Oct 2008 19:00:19 +0000 (12:00 -0700)
commit6aea938f54ca785ce3bea67a8948698225c6ca58
tree0073e089b5c10a5baf116f4978480259c366ec89
parentf6bccf695431da0e9bd773550ae91b8cb9ffb227
RDMA/ucma: Test ucma_alloc_multicast() return against NULL, not with IS_ERR()

In case of error, the function ucma_alloc_multicast() returns a NULL
pointer, but never returns an ERR pointer.  So after a call to this
function, an IS_ERR test should be replaced by a NULL test.

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

// <smpl>
@match bad_is_err_test@
expression x, E;
@@

x = ucma_alloc_multicast(...)
... when != x = E
IS_ERR(x)
// </smpl>

Signed-off-by: Julien Brunel <brunel@diku.dk>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/core/ucma.c