Skip to contentSkip to conversation

net: fix comment above build_skb()

PATCH Applied Florian Fainelli 2 participants 2 messages Jul 23, 2013 – Jul 25, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: fix comment above build_skb()

build_skb() specifies that the data parameter must come from a kmalloc'd area, this is only true if frag_size equals 0, because then build_skb() will use kzsize(data) to figure out the actual data size. Update the comment to reflect that special condition.

---
Changes since v1:
- explain the case where frag_size != 0

 net/core/skbuff.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/core/skbuff.c +2 -1
index 20e02d2..3df4d4c 100644
@@ -309,7 +309,8 @@ EXPORT_SYMBOL(__alloc_skb);
  * @frag_size: size of fragment, or 0 if head was kmalloced
  *
  * Allocate a new &sk_buff. Caller provides space holding head and
- * skb_shared_info. @data must have been allocated by kmalloc()
+ * skb_shared_info. @data must have been allocated by kmalloc() only if
+ * @frag_size is 0, otherwise data should come from the page allocator.
  * The return is the new skb buffer.
  * On a failure the return is %NULL, and @data is not freed.
  * Notes :
Signature · 1 line
1.8.1.2
maintainer Applied
#1 lore raw

From: "Florian Fainelli" <[email protected]>
Date: Tue, 23 Jul 2013 20:22:39 +0100

Quoted 6 lines

build_skb() specifies that the data parameter must come from a kmalloc'd area, this is only true if frag_size equals 0, because then build_skb() will use kzsize(data) to figure out the actual data size. Update the comment to reflect that special condition.

Applied, thanks.