Skip to content

Commit

Permalink
tipc: fix sparse warnings
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Erik Hugne authored and David S. Miller committed Sep 10, 2014
1 parent cf98192 commit 0fc4dff
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions net/tipc/name_distr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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),
Expand All @@ -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;
}

/**
Expand Down

0 comments on commit 0fc4dff

Please sign in to comment.