source: packages/net/batman-adv/patches/0003-batman-adv_remove_references_for_global_tt_entries.patch @ 28575

Last change on this file since 28575 was 28575, checked in by marek, 5 years ago

batman-adv: bugfixes for the 2011.3.1 release

Signed-off-by: Marek Lindner <lindner_marek@…>

File size: 1.8 KB
  • compat.c

    struct tt_global_entry holds a reference to an orig_node which must be
    decremented before deallocating the structure.
    
    Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
    ---
     compat.c            |    8 --------
     compat.h            |    1 -
     translation-table.c |   14 +++++++++++++-
     3 files changed, 13 insertions(+), 10 deletions(-)
    
    a b void free_rcu_tt_local_entry(struct rcu_head *rcu) 
    3636        kfree(tt_local_entry); 
    3737} 
    3838 
    39 void free_rcu_tt_global_entry(struct rcu_head *rcu) 
    40 { 
    41         struct tt_global_entry *tt_global_entry; 
    42  
    43         tt_global_entry = container_of(rcu, struct tt_global_entry, rcu); 
    44         kfree(tt_global_entry); 
    45 } 
    46  
    4739#endif /* < KERNEL_VERSION(3, 0, 0) */ 
  • compat.h

    a b void free_rcu_gw_node(struct rcu_head *rcu); 
    6363void free_rcu_neigh_node(struct rcu_head *rcu); 
    6464void free_rcu_softif_neigh(struct rcu_head *rcu); 
    6565void free_rcu_tt_local_entry(struct rcu_head *rcu); 
    66 void free_rcu_tt_global_entry(struct rcu_head *rcu); 
    6766 
    6867#endif /* < KERNEL_VERSION(3, 0, 0) */ 
    6968 
  • translation-table.c

    a b static void tt_local_entry_free_ref(struct tt_local_entry *tt_local_entry) 
    137137                kfree_rcu(tt_local_entry, rcu); 
    138138} 
    139139 
     140static void tt_global_entry_free_rcu(struct rcu_head *rcu) 
     141{ 
     142        struct tt_global_entry *tt_global_entry; 
     143 
     144        tt_global_entry = container_of(rcu, struct tt_global_entry, rcu); 
     145 
     146        if (tt_global_entry->orig_node) 
     147                orig_node_free_ref(tt_global_entry->orig_node); 
     148 
     149        kfree(tt_global_entry); 
     150} 
     151 
    140152static void tt_global_entry_free_ref(struct tt_global_entry *tt_global_entry) 
    141153{ 
    142154        if (atomic_dec_and_test(&tt_global_entry->refcount)) 
    143                 kfree_rcu(tt_global_entry, rcu); 
     155                call_rcu(&tt_global_entry->rcu, tt_global_entry_free_rcu); 
    144156} 
    145157 
    146158static void tt_local_event(struct bat_priv *bat_priv, const uint8_t *addr, 
Note: See TracBrowser for help on using the repository browser.