diff options
| author | Alexander Aring <alex.aring@gmail.com> | 2015-09-02 08:21:22 -0400 |
|---|---|---|
| committer | Marcel Holtmann <marcel@holtmann.org> | 2015-09-17 07:20:03 -0400 |
| commit | ad23d5b9da399c0ecbe58e16c6603c3fcdcafdbd (patch) | |
| tree | 3426a29d86696fec800e7af1072750c470cfb083 /net/ieee802154 | |
| parent | 989d433dca558fda85e592fc675af2a59af88858 (diff) | |
ieee802154: 6lowpan: cleanup pull of iphc bytes
This patch cleanups the pull of the iphc bytes. We don't need to check
if the skb->len contains two bytes, this will be checked by
lowpan_fetch_skb_u8.
Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/ieee802154')
| -rw-r--r-- | net/ieee802154/6lowpan/rx.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/net/ieee802154/6lowpan/rx.c b/net/ieee802154/6lowpan/rx.c index c529d9f2561f..4ddf69445032 100644 --- a/net/ieee802154/6lowpan/rx.c +++ b/net/ieee802154/6lowpan/rx.c | |||
| @@ -33,14 +33,9 @@ iphc_decompress(struct sk_buff *skb, const struct ieee802154_hdr *hdr) | |||
| 33 | void *sap, *dap; | 33 | void *sap, *dap; |
| 34 | 34 | ||
| 35 | raw_dump_table(__func__, "raw skb data dump", skb->data, skb->len); | 35 | raw_dump_table(__func__, "raw skb data dump", skb->data, skb->len); |
| 36 | /* at least two bytes will be used for the encoding */ | ||
| 37 | if (skb->len < 2) | ||
| 38 | return -EINVAL; | ||
| 39 | |||
| 40 | if (lowpan_fetch_skb_u8(skb, &iphc0)) | ||
| 41 | return -EINVAL; | ||
| 42 | 36 | ||
| 43 | if (lowpan_fetch_skb_u8(skb, &iphc1)) | 37 | if (lowpan_fetch_skb_u8(skb, &iphc0) || |
| 38 | lowpan_fetch_skb_u8(skb, &iphc1)) | ||
| 44 | return -EINVAL; | 39 | return -EINVAL; |
| 45 | 40 | ||
| 46 | ieee802154_addr_to_sa(&sa, &hdr->source); | 41 | ieee802154_addr_to_sa(&sa, &hdr->source); |
