Skip to contentSkip to conversation

batman-adv: return NULL instead of 0 in batadv_mcast_forw_ip_node_get()

PATCH Applied Linus Lüssing 2 participants 2 messages Feb 16, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 batman-adv: return NULL instead of 0 in batadv_mcast_forw_ip_node_get()

batadv_mcast_forw_ip_node_get() returns a pointer, so returning NULL in error cases is always more appropriate than 0.

Introduced by: c8fedbea81eac41a4971bb43353fd52a903d7c4c ("batman-adv: Send multicast packets to nodes with a WANT_ALL flag")

---
* added Reported-by

 multicast.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
multicast.c +1 -1
index b2abe00..00bb30e 100644
@@ -498,7 +498,7 @@ batadv_mcast_forw_ip_node_get(struct batadv_priv *bat_priv,
 		return batadv_mcast_forw_ipv6_node_get(bat_priv);
 	default:
 		/* we shouldn't be here... */
-		return 0;
+		return NULL;
 	}
 }
 
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 6 lines · On Sunday 16 February 2014 10:27:58 Linus Lüssing wrote:

batadv_mcast_forw_ip_node_get() returns a pointer, so returning NULL in error cases is always more appropriate than 0.

Introduced by: c8fedbea81eac41a4971bb43353fd52a903d7c4c ("batman-adv: Send multicast packets to nodes with a WANT_ALL flag")

Quoted 7 lines

---
* added Reported-by

 multicast.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied in revision 0dd5d2c.

Thanks,
Marek