On Monday, April 11, 2016 13:06:40 Sven Eckelmann wrote:
The callers of the functions using batadv_hard_iface objects already make sure that they hold a valid reference. The subfunctions don't have to check whether the reference counter is > 0 because this was checked by the callers.
The kref_get function instead WARNs (with debug information) when the reference counter would still be 0. This makes a bug in batman-adv better visible because kref_get_unless_zero would have ignored this problem.
Signed-off-by: Sven Eckelmann sven@narfation.org
v2:
- Fix imbalance in batadv_iv_ogm_aggregate_new
- Adjust commit message
net/batman-adv/bat_iv_ogm.c | 14 +++----------- net/batman-adv/hard-interface.c | 7 +++---- net/batman-adv/originator.c | 30 +++++++----------------------- 3 files changed, 13 insertions(+), 38 deletions(-)
Applied in revision 04614cb.
Thanks, Marek