diff options
author | Varka Bhadram <varkab@cdac.in> | 2014-08-11 07:25:08 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-08-14 02:49:25 -0400 |
commit | b288a4963f09459c29cca240d3352cc7915710fc (patch) | |
tree | f36e85ef1f541280b75401e431dd422c17564586 /net/mac802154/wpan.c | |
parent | 24bbd44a96c7a209fafbf1b28f0ac1a00cf4e551 (diff) |
mac802154: common error path
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>
Diffstat (limited to 'net/mac802154/wpan.c')
-rw-r--r-- | net/mac802154/wpan.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/mac802154/wpan.c b/net/mac802154/wpan.c index 3c3069fd6971..ce1757001917 100644 --- a/net/mac802154/wpan.c +++ b/net/mac802154/wpan.c | |||
@@ -472,8 +472,7 @@ mac802154_subif_frame(struct mac802154_sub_if_data *sdata, struct sk_buff *skb, | |||
472 | rc = mac802154_llsec_decrypt(&sdata->sec, skb); | 472 | rc = mac802154_llsec_decrypt(&sdata->sec, skb); |
473 | if (rc) { | 473 | if (rc) { |
474 | pr_debug("decryption failed: %i\n", rc); | 474 | pr_debug("decryption failed: %i\n", rc); |
475 | kfree_skb(skb); | 475 | goto fail; |
476 | return NET_RX_DROP; | ||
477 | } | 476 | } |
478 | 477 | ||
479 | sdata->dev->stats.rx_packets++; | 478 | sdata->dev->stats.rx_packets++; |
@@ -485,9 +484,12 @@ mac802154_subif_frame(struct mac802154_sub_if_data *sdata, struct sk_buff *skb, | |||
485 | default: | 484 | default: |
486 | pr_warn("ieee802154: bad frame received (type = %d)\n", | 485 | pr_warn("ieee802154: bad frame received (type = %d)\n", |
487 | mac_cb(skb)->type); | 486 | mac_cb(skb)->type); |
488 | kfree_skb(skb); | 487 | goto fail; |
489 | return NET_RX_DROP; | ||
490 | } | 488 | } |
489 | |||
490 | fail: | ||
491 | kfree_skb(skb); | ||
492 | return NET_RX_DROP; | ||
491 | } | 493 | } |
492 | 494 | ||
493 | static void mac802154_print_addr(const char *name, | 495 | static void mac802154_print_addr(const char *name, |