Skip to content

Commit

Permalink
tipc: limit error messages relating to memory leak to one line
Browse files Browse the repository at this point in the history
With the default name table size of 1024, it is possible that
the sanity check in tipc_nametbl_stop could spam out 1024
essentially identical error messages if memory was corrupted
or similar.  Limit it to issuing no more than a single message.

The actual chain number (i.e. 0 --> 1023) wouldn't provide any
useful insight if/when such an instance happened, so don't
bother printing out that value.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
  • Loading branch information
Paul Gortmaker committed Jul 12, 2012
1 parent 7e9cab5 commit f705ab9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/tipc/name_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,8 +940,10 @@ void tipc_nametbl_stop(void)
/* Verify name table is empty, then release it */
write_lock_bh(&tipc_nametbl_lock);
for (i = 0; i < tipc_nametbl_size; i++) {
if (!hlist_empty(&table.types[i]))
err("tipc_nametbl_stop(): hash chain %u is non-null\n", i);
if (hlist_empty(&table.types[i]))
continue;
err("tipc_nametbl_stop(): orphaned hash chain detected\n");
break;
}
kfree(table.types);
table.types = NULL;
Expand Down

0 comments on commit f705ab9

Please sign in to comment.