diff mbox series

[net-next] tipc: checking for NULL instead of IS_ERR()

Message ID 20171018074825.2bi42vewrqhdbte3@mwanda
State Accepted, archived
Delegated to: David Miller
Headers show
Series [net-next] tipc: checking for NULL instead of IS_ERR() | expand

Commit Message

Dan Carpenter Oct. 18, 2017, 7:48 a.m. UTC
The tipc_alloc_conn() function never returns NULL, it returns error
pointers, so I have fixed the check.

Fixes: 14c04493cb77 ("tipc: add ability to order and receive topology events in driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

David Miller Oct. 20, 2017, 7:34 a.m. UTC | #1
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 18 Oct 2017 10:48:25 +0300

> The tipc_alloc_conn() function never returns NULL, it returns error
> pointers, so I have fixed the check.
> 
> Fixes: 14c04493cb77 ("tipc: add ability to order and receive topology events in driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks Dan.
diff mbox series

Patch

diff --git a/net/tipc/server.c b/net/tipc/server.c
index 713077536d0c..acaef80fb88c 100644
--- a/net/tipc/server.c
+++ b/net/tipc/server.c
@@ -504,7 +504,7 @@  bool tipc_topsrv_kern_subscr(struct net *net, u32 port, u32 type,
 	*(u32 *)&sub.usr_handle = port;
 
 	con = tipc_alloc_conn(tipc_topsrv(net));
-	if (!con)
+	if (IS_ERR(con))
 		return false;
 
 	*conid = con->conid;