From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Marek Lindner Date: Sat, 30 Mar 2013 23:01:29 +0800 References: <1364654967-25455-1-git-send-email-ordex@autistici.org> In-Reply-To: <1364654967-25455-1-git-send-email-ordex@autistici.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201303302301.29913.lindner_marek@yahoo.de> Subject: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: do not silently ignore wrong condition Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: The list for a Better Approach To Mobile Ad-hoc Networking On Saturday, March 30, 2013 22:49:27 Antonio Quartulli wrote: > @@ -669,7 +669,7 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv, > if (batadv_compare_eth(neigh_addr, ethhdr->h_source) && > tmp_neigh_node->if_incoming == if_incoming && > atomic_inc_not_zero(&tmp_neigh_node->refcount)) { > - if (neigh_node) > + if (WARN(neigh_node, "too many matching > neigh_nodes") batadv_neigh_node_free_ref(neigh_node); neigh_node = > tmp_neigh_node; > continue; I wasn't aware one could throw the warning right in the if-statement but for the sake of readability, please don't do that. Cheers, Marek