diff options
author | Gal Pressman <gal@nvidia.com> | 2023-03-08 15:17:20 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-03-10 16:49:21 -0800 |
commit | 3c6401266f91c69771176d3b289abfeaec731611 (patch) | |
tree | 9e4b1e05c3b934c6e03039df96df3f163cad750b /net | |
parent | 566b6701d5dfc823d1e7ee27a7f0c5719f4b93dd (diff) |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/skbuff.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index de465368fc2c..050a875d09c5 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -420,7 +420,7 @@ struct sk_buff *build_skb(void *data, unsigned int frag_size) { struct sk_buff *skb = __build_skb(data, frag_size); - if (skb && frag_size) { + if (likely(skb && frag_size)) { skb->head_frag = 1; skb_propagate_pfmemalloc(virt_to_head_page(data), skb); } |