Skip to content

Commit

Permalink
mac802154: common error path
Browse files Browse the repository at this point in the history
By introducing label fail, making the common error path for
mac802154_llsec_decrypt() and packet type default case.

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Varka Bhadram authored and Marcel Holtmann committed Aug 14, 2014
1 parent 24bbd44 commit b288a49
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions net/mac802154/wpan.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,7 @@ mac802154_subif_frame(struct mac802154_sub_if_data *sdata, struct sk_buff *skb,
rc = mac802154_llsec_decrypt(&sdata->sec, skb);
if (rc) {
pr_debug("decryption failed: %i\n", rc);
kfree_skb(skb);
return NET_RX_DROP;
goto fail;
}

sdata->dev->stats.rx_packets++;
Expand All @@ -485,9 +484,12 @@ mac802154_subif_frame(struct mac802154_sub_if_data *sdata, struct sk_buff *skb,
default:
pr_warn("ieee802154: bad frame received (type = %d)\n",
mac_cb(skb)->type);
kfree_skb(skb);
return NET_RX_DROP;
goto fail;
}

fail:
kfree_skb(skb);
return NET_RX_DROP;
}

static void mac802154_print_addr(const char *name,
Expand Down

0 comments on commit b288a49

Please sign in to comment.