ieee802154: 6lowpan: fix error frag handling

This change “ieee802154: 6lowpan: fix error frag handling” in Linux kernel is authored by Alexander Aring <alex.aring [at]> on Mon Aug 10 21:15:59 2015 +0200.

ieee802154: 6lowpan: fix error frag handling

This patch fixes the error handling for lowpan_xmit_fragment by replace
"-PTR_ERR" to "PTR_ERR". PTR_ERR returns already a negative errno code.

Signed-off-by: Alexander Aring <>
Signed-off-by: Marcel Holtmann <>

This Linux change may have been applied to various maintained Linux releases and you can find Linux releases including commit 8f8db91.

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 net/ieee802154/6lowpan/tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ieee802154/6lowpan/tx.c b/net/ieee802154/6lowpan/tx.c
index 1bf4a30..f6263fc 100644
--- a/net/ieee802154/6lowpan/tx.c
+++ b/net/ieee802154/6lowpan/tx.c
@@ -112,7 +112,7 @@ int lowpan_header_create(struct sk_buff *skb, struct net_device *dev,
 	frag = lowpan_alloc_frag(skb, frag_hdrlen + len, wpan_hdr);
 	if (IS_ERR(frag))
-		return -PTR_ERR(frag);
+		return PTR_ERR(frag);
 	memcpy(skb_put(frag, frag_hdrlen), frag_hdr, frag_hdrlen);
 	memcpy(skb_put(frag, len), skb_network_header(skb) + offset, len);

The commit for this change in Linux stable tree is 8f8db91 (patch).

Leave a Reply

Your email address will not be published. Required fields are marked *