b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unnecessary check for orig_ifinfo == NULL
@ 2015-03-01 15:56 Sven Eckelmann
  2015-03-09  0:31 ` Marek Lindner
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Eckelmann @ 2015-03-01 15:56 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

orig_ifinfo is dereferenced multiple times in batadv_iv_ogm_update_seqnos
before the check for NULL is done. The function also exists at the beginning
when orig_ifinfo would have been NULL. This makes the check at the end
unnecessary and only confuses the reader/code analyzers.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 bat_iv_ogm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index 554e0e0..04bd220 100644
--- a/bat_iv_ogm.c
+++ b/bat_iv_ogm.c
@@ -1357,8 +1357,7 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
 out:
 	spin_unlock_bh(&orig_node->bat_iv.ogm_cnt_lock);
 	batadv_orig_node_free_ref(orig_node);
-	if (orig_ifinfo)
-		batadv_orig_ifinfo_free_ref(orig_ifinfo);
+	batadv_orig_ifinfo_free_ref(orig_ifinfo);
 	return ret;
 }
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unnecessary check for orig_ifinfo == NULL
  2015-03-01 15:56 [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unnecessary check for orig_ifinfo == NULL Sven Eckelmann
@ 2015-03-09  0:31 ` Marek Lindner
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Lindner @ 2015-03-09  0:31 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

On Sunday, March 01, 2015 16:56:26 Sven Eckelmann wrote:
> orig_ifinfo is dereferenced multiple times in batadv_iv_ogm_update_seqnos
> before the check for NULL is done. The function also exists at the beginning
> when orig_ifinfo would have been NULL. This makes the check at the end
> unnecessary and only confuses the reader/code analyzers.
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
>  bat_iv_ogm.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied in revision 8435e41.

Thanks,
Marek

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-09  0:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-01 15:56 [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unnecessary check for orig_ifinfo == NULL Sven Eckelmann
2015-03-09  0:31 ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).