Skip to content

Commit 0843f19

Browse files
gfreewindsimonwunderlich
authored andcommitted
batman-adv: Remove one condition check in batadv_route_unicast_packet
It could decrease one condition check to collect some statements in the first condition block. Signed-off-by: Gao Feng <[email protected]> Signed-off-by: Sven Eckelmann <[email protected]> Signed-off-by: Simon Wunderlich <[email protected]>
1 parent 269cee6 commit 0843f19

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

net/batman-adv/routing.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -719,20 +719,19 @@ static int batadv_route_unicast_packet(struct sk_buff *skb,
719719

720720
len = skb->len;
721721
res = batadv_send_skb_to_orig(skb, orig_node, recv_if);
722-
if (res == NET_XMIT_SUCCESS)
723-
ret = NET_RX_SUCCESS;
724-
725-
/* skb was consumed */
726-
skb = NULL;
727722

728723
/* translate transmit result into receive result */
729724
if (res == NET_XMIT_SUCCESS) {
725+
ret = NET_RX_SUCCESS;
730726
/* skb was transmitted and consumed */
731727
batadv_inc_counter(bat_priv, BATADV_CNT_FORWARD);
732728
batadv_add_counter(bat_priv, BATADV_CNT_FORWARD_BYTES,
733729
len + ETH_HLEN);
734730
}
735731

732+
/* skb was consumed */
733+
skb = NULL;
734+
736735
put_orig_node:
737736
batadv_orig_node_put(orig_node);
738737
free_skb:

0 commit comments

Comments
 (0)