Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Three cases of simple overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -200,9 +200,15 @@ static void tcf_chain_flush(struct tcf_chain *chain)
|
||||
|
||||
static void tcf_chain_destroy(struct tcf_chain *chain)
|
||||
{
|
||||
list_del(&chain->list);
|
||||
tcf_chain_flush(chain);
|
||||
kfree(chain);
|
||||
/* May be already removed from the list by the previous call. */
|
||||
if (!list_empty(&chain->list))
|
||||
list_del_init(&chain->list);
|
||||
|
||||
/* There might still be a reference held when we got here from
|
||||
* tcf_block_put. Wait for the user to drop reference before free.
|
||||
*/
|
||||
if (!chain->refcnt)
|
||||
kfree(chain);
|
||||
}
|
||||
|
||||
struct tcf_chain *tcf_chain_get(struct tcf_block *block, u32 chain_index,
|
||||
@@ -273,8 +279,10 @@ void tcf_block_put(struct tcf_block *block)
|
||||
if (!block)
|
||||
return;
|
||||
|
||||
list_for_each_entry_safe(chain, tmp, &block->chain_list, list)
|
||||
list_for_each_entry_safe(chain, tmp, &block->chain_list, list) {
|
||||
tcf_chain_flush(chain);
|
||||
tcf_chain_destroy(chain);
|
||||
}
|
||||
kfree(block);
|
||||
}
|
||||
EXPORT_SYMBOL(tcf_block_put);
|
||||
|
Reference in New Issue
Block a user