[PATCH bluetooth-next 1/7] 6lowpan: allow pull only at lowpan_fetch_skb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch adds a check on data pointer. If this pointer is NULL we
don't copy data from skb into data. This is useful if we only check if
we can run skb_pull and doing it afterwards.

Cc: Jukka Rissanen <jukka.rissanen@xxxxxxxxxxxxxxx>
Signed-off-by: Alexander Aring <alex.aring@xxxxxxxxx>
---
 include/net/6lowpan.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h
index dc03d77..c64d274 100644
--- a/include/net/6lowpan.h
+++ b/include/net/6lowpan.h
@@ -246,7 +246,9 @@ static inline bool lowpan_fetch_skb(struct sk_buff *skb,
 	if (unlikely(!pskb_may_pull(skb, len)))
 		return true;
 
-	skb_copy_from_linear_data(skb, data, len);
+	if (likely(data))
+		skb_copy_from_linear_data(skb, data, len);
+
 	skb_pull(skb, len);
 
 	return false;
-- 
2.2.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux