Skip to content

Commit c50b7c4

Browse files
committed
Merge branch 'net-zerocopy-fixes'
Saeed Mahameed says: =================== Mellanox, mlx5 fixes 2017-12-19 The follwoing series includes some fixes for mlx5 core and etherent driver. Please pull and let me know if there is any problem. This series doesn't introduce any conflict with the ongoing mlx5 for-next submission. For -stable: kernels >= v4.7.y ("net/mlx5e: Fix possible deadlock of VXLAN lock") ("net/mlx5e: Add refcount to VXLAN structure") ("net/mlx5e: Prevent possible races in VXLAN control flow") ("net/mlx5e: Fix features check of IPv6 traffic") kernels >= v4.9.y ("net/mlx5: Fix error flow in CREATE_QP command") ("net/mlx5: Fix rate limit packet pacing naming and struct") kernels >= v4.13.y ("net/mlx5: FPGA, return -EINVAL if size is zero") kernels >= v4.14.y ("Revert "mlx5: move affinity hints assignments to generic code") All above patches apply and compile with no issues on corresponding -stable. =================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 513674b + b90ddd5 commit c50b7c4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

net/core/skbuff.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask)
11781178
u32 d_off;
11791179

11801180
if (!num_frags)
1181-
return 0;
1181+
goto release;
11821182

11831183
if (skb_shared(skb) || skb_unclone(skb, gfp_mask))
11841184
return -EINVAL;
@@ -1238,6 +1238,7 @@ int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask)
12381238
__skb_fill_page_desc(skb, new_frags - 1, head, 0, d_off);
12391239
skb_shinfo(skb)->nr_frags = new_frags;
12401240

1241+
release:
12411242
skb_zcopy_clear(skb, false);
12421243
return 0;
12431244
}
@@ -3654,8 +3655,6 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,
36543655

36553656
skb_shinfo(nskb)->tx_flags |= skb_shinfo(head_skb)->tx_flags &
36563657
SKBTX_SHARED_FRAG;
3657-
if (skb_zerocopy_clone(nskb, head_skb, GFP_ATOMIC))
3658-
goto err;
36593658

36603659
while (pos < offset + len) {
36613660
if (i >= nfrags) {
@@ -3681,6 +3680,8 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,
36813680

36823681
if (unlikely(skb_orphan_frags(frag_skb, GFP_ATOMIC)))
36833682
goto err;
3683+
if (skb_zerocopy_clone(nskb, frag_skb, GFP_ATOMIC))
3684+
goto err;
36843685

36853686
*nskb_frag = *frag;
36863687
__skb_frag_ref(nskb_frag);

0 commit comments

Comments
 (0)