summaryrefslogtreecommitdiffstats
path: root/net/core/skbuff.c
diff options
context:
space:
mode:
authorGal Pressman <gal@nvidia.com>2023-03-08 15:17:20 +0200
committerJakub Kicinski <kuba@kernel.org>2023-03-10 16:49:21 -0800
commit3c6401266f91c69771176d3b289abfeaec731611 (patch)
tree9e4b1e05c3b934c6e03039df96df3f163cad750b /net/core/skbuff.c
parent566b6701d5dfc823d1e7ee27a7f0c5719f4b93dd (diff)
downloadlinux-3c6401266f91c69771176d3b289abfeaec731611.tar.gz
linux-3c6401266f91c69771176d3b289abfeaec731611.tar.bz2
linux-3c6401266f91c69771176d3b289abfeaec731611.zip
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/core/skbuff.c')
-rw-r--r--net/core/skbuff.c2
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);
}