diff options
author | Erik Hugne <erik.hugne@ericsson.com> | 2014-09-10 14:02:50 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-10 14:00:58 -0700 |
commit | 0fc4dffad13e81deb3bf72e74cac292172df5285 (patch) | |
tree | 64b465568169e2c86d5d1f7093735225c9d27860 /net/tipc/name_distr.c | |
parent | cf98192d2e2b923241b8e6eee05a5b31f4bc16f2 (diff) | |
download | op-kernel-dev-0fc4dffad13e81deb3bf72e74cac292172df5285.zip op-kernel-dev-0fc4dffad13e81deb3bf72e74cac292172df5285.tar.gz |
tipc: fix sparse warnings
This fixes the following sparse warnings:
sparse: symbol 'tipc_update_nametbl' was not declared. Should it be static?
Also, the function is changed to return bool upon success, rather than a
potentially freed pointer.
Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/name_distr.c')
-rw-r--r-- | net/tipc/name_distr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c index 780ef71..376d2bb 100644 --- a/net/tipc/name_distr.c +++ b/net/tipc/name_distr.c @@ -284,8 +284,7 @@ static void named_purge_publ(struct publication *publ) * tipc_nametbl_lock must be held. * Returns the publication item if successful, otherwise NULL. */ -struct publication *tipc_update_nametbl(struct distr_item *i, u32 node, - u32 dtype) +static bool tipc_update_nametbl(struct distr_item *i, u32 node, u32 dtype) { struct publication *publ = NULL; @@ -298,6 +297,7 @@ struct publication *tipc_update_nametbl(struct distr_item *i, u32 node, tipc_nodesub_subscribe(&publ->subscr, node, publ, (net_ev_handler) named_purge_publ); + return true; } } else if (dtype == WITHDRAWAL) { publ = tipc_nametbl_remove_publ(ntohl(i->type), ntohl(i->lower), @@ -306,11 +306,12 @@ struct publication *tipc_update_nametbl(struct distr_item *i, u32 node, if (publ) { tipc_nodesub_unsubscribe(&publ->subscr); kfree(publ); + return true; } } else { pr_warn("Unrecognized name table message received\n"); } - return publ; + return false; } /** |