aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/skbuff.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r--net/core/skbuff.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 2df012be973..7c571560e9d 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1290,12 +1290,14 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset,
1290{ 1290{
1291 unsigned int nr_pages = spd->nr_pages; 1291 unsigned int nr_pages = spd->nr_pages;
1292 unsigned int poff, plen, len, toff, tlen; 1292 unsigned int poff, plen, len, toff, tlen;
1293 int headlen, seg; 1293 int headlen, seg, error = 0;
1294 1294
1295 toff = *offset; 1295 toff = *offset;
1296 tlen = *total_len; 1296 tlen = *total_len;
1297 if (!tlen) 1297 if (!tlen) {
1298 error = 1;
1298 goto err; 1299 goto err;
1300 }
1299 1301
1300 /* 1302 /*
1301 * if the offset is greater than the linear part, go directly to 1303 * if the offset is greater than the linear part, go directly to
@@ -1337,7 +1339,8 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset,
1337 * just jump directly to update and return, no point 1339 * just jump directly to update and return, no point
1338 * in going over fragments when the output is full. 1340 * in going over fragments when the output is full.
1339 */ 1341 */
1340 if (spd_fill_page(spd, virt_to_page(p), plen, poff, skb)) 1342 error = spd_fill_page(spd, virt_to_page(p), plen, poff, skb);
1343 if (error)
1341 goto done; 1344 goto done;
1342 1345
1343 tlen -= plen; 1346 tlen -= plen;
@@ -1367,7 +1370,8 @@ map_frag:
1367 if (!plen) 1370 if (!plen)
1368 break; 1371 break;
1369 1372
1370 if (spd_fill_page(spd, f->page, plen, poff, skb)) 1373 error = spd_fill_page(spd, f->page, plen, poff, skb);
1374 if (error)
1371 break; 1375 break;
1372 1376
1373 tlen -= plen; 1377 tlen -= plen;
@@ -1380,7 +1384,10 @@ done:
1380 return 0; 1384 return 0;
1381 } 1385 }
1382err: 1386err:
1383 return 1; 1387 /* update the offset to reflect the linear part skip, if any */
1388 if (!error)
1389 *offset = toff;
1390 return error;
1384} 1391}
1385 1392
1386/* 1393/*