Skip to content

Commit

Permalink
tipc: remove pointless check for NULL prior to kfree
Browse files Browse the repository at this point in the history
It is acceptable to call kfree() with NULL, so these checks are not
serving any useful purpose.

Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Allan Stephens authored and David S. Miller committed Jan 1, 2011
1 parent 886ef52 commit e83504f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions net/tipc/name_distr.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,7 @@ static void node_is_down(struct publication *publ)
publ->type, publ->lower, publ->node, publ->ref, publ->key);
}

if (p) {
kfree(p);
}
kfree(p);
}

/**
Expand Down
4 changes: 1 addition & 3 deletions net/tipc/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,7 @@ int tipc_deleteport(u32 ref)
buf = port_build_peer_abort_msg(p_ptr, TIPC_ERR_NO_PORT);
tipc_nodesub_unsubscribe(&p_ptr->subscription);
}
if (p_ptr->user_port) {
kfree(p_ptr->user_port);
}
kfree(p_ptr->user_port);

spin_lock_bh(&tipc_port_list_lock);
list_del(&p_ptr->port_list);
Expand Down

0 comments on commit e83504f

Please sign in to comment.