]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mac802154: common error path
authorVarka Bhadram <varkab@cdac.in>
Mon, 11 Aug 2014 11:25:08 +0000 (13:25 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 14 Aug 2014 06:49:25 +0000 (08:49 +0200)
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>
net/mac802154/wpan.c

index 3c3069fd69718277fc719e82d7bf2c51bb9747db..ce1757001917a3654f732274bc24130f78e6406c 100644 (file)
@@ -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++;
@@ -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,