Commit 0fc4dffa authored by Erik Hugne's avatar Erik Hugne Committed by David S. Miller

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: default avatarErik Hugne <erik.hugne@ericsson.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cf98192d
...@@ -284,8 +284,7 @@ static void named_purge_publ(struct publication *publ) ...@@ -284,8 +284,7 @@ static void named_purge_publ(struct publication *publ)
* tipc_nametbl_lock must be held. * tipc_nametbl_lock must be held.
* Returns the publication item if successful, otherwise NULL. * Returns the publication item if successful, otherwise NULL.
*/ */
struct publication *tipc_update_nametbl(struct distr_item *i, u32 node, static bool tipc_update_nametbl(struct distr_item *i, u32 node, u32 dtype)
u32 dtype)
{ {
struct publication *publ = NULL; struct publication *publ = NULL;
...@@ -298,6 +297,7 @@ struct publication *tipc_update_nametbl(struct distr_item *i, u32 node, ...@@ -298,6 +297,7 @@ struct publication *tipc_update_nametbl(struct distr_item *i, u32 node,
tipc_nodesub_subscribe(&publ->subscr, node, publ, tipc_nodesub_subscribe(&publ->subscr, node, publ,
(net_ev_handler) (net_ev_handler)
named_purge_publ); named_purge_publ);
return true;
} }
} else if (dtype == WITHDRAWAL) { } else if (dtype == WITHDRAWAL) {
publ = tipc_nametbl_remove_publ(ntohl(i->type), ntohl(i->lower), 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, ...@@ -306,11 +306,12 @@ struct publication *tipc_update_nametbl(struct distr_item *i, u32 node,
if (publ) { if (publ) {
tipc_nodesub_unsubscribe(&publ->subscr); tipc_nodesub_unsubscribe(&publ->subscr);
kfree(publ); kfree(publ);
return true;
} }
} else { } else {
pr_warn("Unrecognized name table message received\n"); pr_warn("Unrecognized name table message received\n");
} }
return publ; return false;
} }
/** /**
......
Markdown is supported
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