From: Sven Eckelmann Date: Sat, 18 Sep 2010 19:01:20 +0000 (+0200) Subject: Staging: batman-adv: count batman_if list queries as reference X-Git-Tag: v2.6.37-rc1~60^2~3^2~545 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=399fb5b445370ddcc93221e339d02736f55b9bb8;p=pandora-kernel.git Staging: batman-adv: count batman_if list queries as reference The return of get_batman_if_by_netdev and get_active_batman_if leaks a pointer from the rcu protected list of interfaces. We must protect it to prevent a too early release of the memory. Those functions must increase the reference counter before rcu_read_unlock or it may be to late to prevent a free. hardif_add_interface must also increase the reference count for the returned batman_if to make the behaviour consistent. Reported-by: Paul E. McKenney Signed-off-by: Sven Eckelmann Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed