mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
net/rxrpc: Use an IS_ERR test rather than a NULL test
In case of error, the function rxrpc_get_transport returns an ERR pointer, but never returns a NULL pointer. So after a call to this function, a NULL test should be replaced by an IS_ERR test. A simplified version of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @correct_null_test@ expression x,E; statement S1, S2; @@ x = rxrpc_get_transport(...) <... when != x = E if ( ( - x@p2 != NULL + ! IS_ERR ( x ) | - x@p2 == NULL + IS_ERR( x ) ) ) S1 else S2 ...> ? x = E; // </smpl> Signed-off-by: Julien Brunel <brunel@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
317900cb01
commit
34093d055e
1 changed files with 1 additions and 1 deletions
|
@ -100,7 +100,7 @@ static int rxrpc_accept_incoming_call(struct rxrpc_local *local,
|
||||||
|
|
||||||
trans = rxrpc_get_transport(local, peer, GFP_NOIO);
|
trans = rxrpc_get_transport(local, peer, GFP_NOIO);
|
||||||
rxrpc_put_peer(peer);
|
rxrpc_put_peer(peer);
|
||||||
if (!trans) {
|
if (IS_ERR(trans)) {
|
||||||
_debug("no trans");
|
_debug("no trans");
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto error;
|
goto error;
|
||||||
|
|
Loading…
Reference in a new issue