Skip to content

Commit 3c64012

Browse files
gal-pressmankuba-moo
authored andcommitted
skbuff: Add likely to skb pointer in build_skb()
Similarly to napi_build_skb(), it is likely the skb allocation in build_skb() succeeded. frag_size != 0 is also likely, as stated in __build_skb_around(). Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Gal Pressman <gal@nvidia.com> Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 566b670 commit 3c64012

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/skbuff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ struct sk_buff *build_skb(void *data, unsigned int frag_size)
420420
{
421421
struct sk_buff *skb = __build_skb(data, frag_size);
422422

423-
if (skb && frag_size) {
423+
if (likely(skb && frag_size)) {
424424
skb->head_frag = 1;
425425
skb_propagate_pfmemalloc(virt_to_head_page(data), skb);
426426
}

0 commit comments

Comments
 (0)