From: Cong Wang Date: Thu, 22 May 2014 18:57:17 +0000 (-0700) Subject: batman: fix a bogus warning from batadv_is_on_batman_iface() X-Git-Tag: MMI-PSA29.97-13-9~12182^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b6ed5498601df40489606dbc14a9c7011c16630b;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git batman: fix a bogus warning from batadv_is_on_batman_iface() batman tries to search dev->iflink to check if it's a batman interface, but ->iflink could be 0, which is not a valid ifindex. It should just avoid iflink == 0 case. Reported-by: Jet Chen Tested-by: Jet Chen Cc: David S. Miller Cc: Steffen Klassert Cc: Antonio Quartulli Cc: Marek Lindner Signed-off-by: Cong Wang Signed-off-by: Cong Wang Signed-off-by: David S. Miller --- diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index b851cc580853..fbda6b54baff 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -83,7 +83,7 @@ static bool batadv_is_on_batman_iface(const struct net_device *net_dev) return true; /* no more parents..stop recursion */ - if (net_dev->iflink == net_dev->ifindex) + if (net_dev->iflink == 0 || net_dev->iflink == net_dev->ifindex) return false; /* recurse over the parent device */