aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorErik Hugne <erik.hugne@ericsson.com>2014-09-10 08:02:50 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-10 17:00:58 -0400
commit0fc4dffad13e81deb3bf72e74cac292172df5285 (patch)
tree64b465568169e2c86d5d1f7093735225c9d27860 /net/tipc
parentcf98192d2e2b923241b8e6eee05a5b31f4bc16f2 (diff)
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')
-rw-r--r--net/tipc/name_distr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index 780ef710a849..376d2bb51d8d 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)
284 * tipc_nametbl_lock must be held. 284 * tipc_nametbl_lock must be held.
285 * Returns the publication item if successful, otherwise NULL. 285 * Returns the publication item if successful, otherwise NULL.
286 */ 286 */
287struct publication *tipc_update_nametbl(struct distr_item *i, u32 node, 287static bool tipc_update_nametbl(struct distr_item *i, u32 node, u32 dtype)
288 u32 dtype)
289{ 288{
290 struct publication *publ = NULL; 289 struct publication *publ = NULL;
291 290
@@ -298,6 +297,7 @@ struct publication *tipc_update_nametbl(struct distr_item *i, u32 node,
298 tipc_nodesub_subscribe(&publ->subscr, node, publ, 297 tipc_nodesub_subscribe(&publ->subscr, node, publ,
299 (net_ev_handler) 298 (net_ev_handler)
300 named_purge_publ); 299 named_purge_publ);
300 return true;
301 } 301 }
302 } else if (dtype == WITHDRAWAL) { 302 } else if (dtype == WITHDRAWAL) {
303 publ = tipc_nametbl_remove_publ(ntohl(i->type), ntohl(i->lower), 303 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 if (publ) { 306 if (publ) {
307 tipc_nodesub_unsubscribe(&publ->subscr); 307 tipc_nodesub_unsubscribe(&publ->subscr);
308 kfree(publ); 308 kfree(publ);
309 return true;
309 } 310 }
310 } else { 311 } else {
311 pr_warn("Unrecognized name table message received\n"); 312 pr_warn("Unrecognized name table message received\n");
312 } 313 }
313 return publ; 314 return false;
314} 315}
315 316
316/** 317/**