From: Antonio Quartulli Date: Sat, 20 Dec 2014 12:48:57 +0000 (+0100) Subject: batman-adv: avoid NULL dereferences and fix if check X-Git-Tag: omap-for-v4.1/prcm-dts-mfd-syscon-fix~341^2~21 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d1644919578db525b9a7b6c8197ce02adbfce26;p=pandora-kernel.git batman-adv: avoid NULL dereferences and fix if check Gateway having bandwidth_down equal to zero are not accepted at all and so never added to the Gateway list. For this reason checking the bandwidth_down member in batadv_gw_out_of_range() is useless. This is probably a copy/paste error and this check was supposed to be "!gw_node" only. Moreover, the way the check is written now may also lead to a NULL dereference. Fix this by rewriting the if-condition properly. Introduced by 414254e342a0d58144de40c3da777521ebaeeb07 ("batman-adv: tvlv - gateway download/upload bandwidth container") Signed-off-by: Antonio Quartulli Reported-by: David Binderman Signed-off-by: Marek Lindner Signed-off-by: David S. Miller --- Reading git-diff-tree failed