File tree 1 file changed +13
-9
lines changed 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -524,16 +524,20 @@ static int sk_psock_skb_ingress_enqueue(struct sk_buff *skb,
524
524
{
525
525
int num_sge , copied ;
526
526
527
- /* skb linearize may fail with ENOMEM, but lets simply try again
528
- * later if this happens. Under memory pressure we don't want to
529
- * drop the skb. We need to linearize the skb so that the mapping
530
- * in skb_to_sgvec can not error.
531
- */
532
- if (skb_linearize (skb ))
533
- return - EAGAIN ;
534
527
num_sge = skb_to_sgvec (skb , msg -> sg .data , off , len );
535
- if (unlikely (num_sge < 0 ))
536
- return num_sge ;
528
+ if (num_sge < 0 ) {
529
+ /* skb linearize may fail with ENOMEM, but lets simply try again
530
+ * later if this happens. Under memory pressure we don't want to
531
+ * drop the skb. We need to linearize the skb so that the mapping
532
+ * in skb_to_sgvec can not error.
533
+ */
534
+ if (skb_linearize (skb ))
535
+ return - EAGAIN ;
536
+
537
+ num_sge = skb_to_sgvec (skb , msg -> sg .data , off , len );
538
+ if (unlikely (num_sge < 0 ))
539
+ return num_sge ;
540
+ }
537
541
538
542
copied = len ;
539
543
msg -> sg .start = 0 ;
You can’t perform that action at this time.
0 commit comments