Skip to content
Commit 6aea938f authored by Julien Brunel's avatar Julien Brunel Committed by Roland Dreier
Browse files

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: default avatarJulien Brunel <brunel@diku.dk>
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent f6bccf69
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment